StarPU Internal Handbook
barrier_counter.h
Go to the documentation of this file.
1 /* StarPU --- Runtime system for heterogeneous multicore architectures.
2  *
3  * Copyright (C) 2011-2021 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
4  * Copyright (C) 2013 Thibaut Lambert
5  *
6  * StarPU is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation; either version 2.1 of the License, or (at
9  * your option) any later version.
10  *
11  * StarPU is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14  *
15  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
16  */
17 
18 #ifndef __BARRIER_COUNTER_H__
19 #define __BARRIER_COUNTER_H__
20 
23 #include <common/utils.h>
24 #include <common/barrier.h>
25 
27 {
28  struct _starpu_barrier barrier;
29  unsigned min_threshold;
30  unsigned max_threshold;
31  starpu_pthread_cond_t cond2;
32 };
33 
34 int _starpu_barrier_counter_init(struct _starpu_barrier_counter *barrier_c, unsigned count);
35 
36 int _starpu_barrier_counter_destroy(struct _starpu_barrier_counter *barrier_c);
37 
38 int _starpu_barrier_counter_wait_for_empty_counter(struct _starpu_barrier_counter *barrier_c);
39 
40 int _starpu_barrier_counter_wait_until_counter_reaches_down_to_n(struct _starpu_barrier_counter *barrier_c, unsigned n);
41 int _starpu_barrier_counter_wait_until_counter_reaches_up_to_n(struct _starpu_barrier_counter *barrier_c, unsigned n);
42 
43 int _starpu_barrier_counter_wait_for_full_counter(struct _starpu_barrier_counter *barrier_c);
44 
45 int _starpu_barrier_counter_decrement_until_empty_counter(struct _starpu_barrier_counter *barrier_c, double flops);
46 
47 int _starpu_barrier_counter_increment_until_full_counter(struct _starpu_barrier_counter *barrier_c, double flops);
48 
49 int _starpu_barrier_counter_increment(struct _starpu_barrier_counter *barrier_c, double flops);
50 
51 int _starpu_barrier_counter_check(struct _starpu_barrier_counter *barrier_c);
52 
53 int _starpu_barrier_counter_get_reached_start(struct _starpu_barrier_counter *barrier_c);
54 
55 double _starpu_barrier_counter_get_reached_flops(struct _starpu_barrier_counter *barrier_c);
56 #endif
Definition: barrier.h:25
Definition: barrier_counter.h:27