starpu_bitmap.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2013 Simon Archipoff
  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 __STARPU_BITMAP_H__
  17. #define __STARPU_BITMAP_H__
  18. struct starpu_bitmap * starpu_bitmap_create(void);
  19. void starpu_bitmap_destroy(struct starpu_bitmap *);
  20. void starpu_bitmap_set(struct starpu_bitmap *, int);
  21. void starpu_bitmap_unset(struct starpu_bitmap *, int);
  22. void starpu_bitmap_unset_all(struct starpu_bitmap *);
  23. int starpu_bitmap_get(struct starpu_bitmap *, int);
  24. /* basicaly compute starpu_bitmap_unset_all(a) ; a = b & c; */
  25. void starpu_bitmap_unset_and(struct starpu_bitmap * a, struct starpu_bitmap * b, struct starpu_bitmap * c);
  26. /* this is basically compute a |= b;*/
  27. void starpu_bitmap_or(struct starpu_bitmap * a,
  28. struct starpu_bitmap * b);
  29. //return 1 iff e set in b1 AND e set in b2
  30. int starpu_bitmap_and_get(struct starpu_bitmap * b1,
  31. struct starpu_bitmap * b2,
  32. int e);
  33. int starpu_bitmap_cardinal(struct starpu_bitmap *);
  34. //return the index of first bit, -1 if none
  35. int starpu_bitmap_first(struct starpu_bitmap *);
  36. int starpu_bitmap_last(struct starpu_bitmap *);
  37. //return the index of bit right after e, -1 if none
  38. int starpu_bitmap_next(struct starpu_bitmap *, int e);
  39. #endif