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-2023 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
26#pragma GCC visibility push(hidden)
27
29{
30 struct _starpu_barrier barrier;
31 unsigned min_threshold;
32 unsigned max_threshold;
33 starpu_pthread_cond_t cond2;
34};
35
36int _starpu_barrier_counter_init(struct _starpu_barrier_counter *barrier_c, unsigned count);
37
38int _starpu_barrier_counter_destroy(struct _starpu_barrier_counter *barrier_c);
39
40int _starpu_barrier_counter_wait_for_empty_counter(struct _starpu_barrier_counter *barrier_c);
41
42int _starpu_barrier_counter_wait_until_counter_reaches_down_to_n(struct _starpu_barrier_counter *barrier_c, unsigned n);
43int _starpu_barrier_counter_wait_until_counter_reaches_up_to_n(struct _starpu_barrier_counter *barrier_c, unsigned n);
44
45int _starpu_barrier_counter_wait_for_full_counter(struct _starpu_barrier_counter *barrier_c);
46
47int _starpu_barrier_counter_decrement_until_empty_counter(struct _starpu_barrier_counter *barrier_c, double flops);
48
49int _starpu_barrier_counter_increment_until_full_counter(struct _starpu_barrier_counter *barrier_c, double flops);
50
51int _starpu_barrier_counter_increment(struct _starpu_barrier_counter *barrier_c, double flops);
52
53int _starpu_barrier_counter_check(struct _starpu_barrier_counter *barrier_c);
54
55int _starpu_barrier_counter_get_reached_start(struct _starpu_barrier_counter *barrier_c);
56
57int _starpu_barrier_counter_get_reached_exit(struct _starpu_barrier_counter *barrier_c);
58
59double _starpu_barrier_counter_get_reached_flops(struct _starpu_barrier_counter *barrier_c);
60
61#pragma GCC visibility pop
62
63#endif
Definition: barrier.h:27
Definition: barrier_counter.h:29