barrier_counter.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2011 INRIA
  4. *
  5. * StarPU is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU Lesser General Public License as published by
  7. * the Free Software Foundation; either version 2.1 of the License, or (at
  8. * your option) any later version.
  9. *
  10. * StarPU is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. *
  14. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  15. */
  16. #ifndef __BARRIER_COUNTER_H__
  17. #define __BARRIER_COUNTER_H__
  18. #include <common/utils.h>
  19. #include <common/barrier.h>
  20. struct _starpu_barrier_counter
  21. {
  22. struct _starpu_barrier barrier;
  23. starpu_pthread_cond_t cond2;
  24. };
  25. int _starpu_barrier_counter_init(struct _starpu_barrier_counter *barrier_c, int count);
  26. int _starpu_barrier_counter_destroy(struct _starpu_barrier_counter *barrier_c);
  27. int _starpu_barrier_counter_wait_for_empty_counter(struct _starpu_barrier_counter *barrier_c);
  28. int _starpu_barrier_counter_wait_for_full_counter(struct _starpu_barrier_counter *barrier_c);
  29. int _starpu_barrier_counter_decrement_until_empty_counter(struct _starpu_barrier_counter *barrier_c, double flops);
  30. int _starpu_barrier_counter_increment_until_full_counter(struct _starpu_barrier_counter *barrier_c, double flops);
  31. int _starpu_barrier_counter_increment(struct _starpu_barrier_counter *barrier_c, double flops);
  32. int _starpu_barrier_counter_check(struct _starpu_barrier_counter *barrier_c);
  33. int _starpu_barrier_counter_get_reached_start(struct _starpu_barrier_counter *barrier_c);
  34. double _starpu_barrier_counter_get_reached_flops(struct _starpu_barrier_counter *barrier_c);
  35. #endif