starpu_task_util.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /* StarPU --- Runtime system for heterogeneous multicore architectures.
  2. *
  3. * Copyright (C) 2010-2014 Université de Bordeaux 1
  4. * Copyright (C) 2010-2013 Centre National de la Recherche Scientifique
  5. * Copyright (C) 2014 INRIA
  6. *
  7. * StarPU is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU Lesser General Public License as published by
  9. * the Free Software Foundation; either version 2.1 of the License, or (at
  10. * your option) any later version.
  11. *
  12. * StarPU is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  15. *
  16. * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  17. */
  18. #ifndef __STARPU_TASK_UTIL_H__
  19. #define __STARPU_TASK_UTIL_H__
  20. #include <stdio.h>
  21. #include <stdlib.h>
  22. #include <string.h>
  23. #include <assert.h>
  24. #include <starpu.h>
  25. #ifdef __cplusplus
  26. extern "C"
  27. {
  28. #endif
  29. void starpu_create_sync_task(starpu_tag_t sync_tag, unsigned ndeps, starpu_tag_t *deps, void (*callback)(void *), void *callback_arg);
  30. #define STARPU_VALUE (1<<20)
  31. #define STARPU_CALLBACK (2<<20)
  32. #define STARPU_CALLBACK_WITH_ARG (3<<20)
  33. #define STARPU_CALLBACK_ARG (4<<20)
  34. #define STARPU_PRIORITY (5<<20)
  35. #define STARPU_EXECUTE_ON_NODE (6<<20)
  36. #define STARPU_EXECUTE_ON_DATA (7<<20)
  37. #define STARPU_DATA_ARRAY (8<<20)
  38. #define STARPU_TAG (9<<20)
  39. #define STARPU_HYPERVISOR_TAG (10<<20)
  40. #define STARPU_FLOPS (11<<20)
  41. #define STARPU_SCHED_CTX (12<<20)
  42. #define STARPU_PROLOGUE_CALLBACK (13<<20)
  43. #define STARPU_PROLOGUE_CALLBACK_ARG (14<<20)
  44. #define STARPU_PROLOGUE_CALLBACK_POP (15<<20)
  45. #define STARPU_PROLOGUE_CALLBACK_POP_ARG (16<<20)
  46. #define STARPU_EXECUTE_ON_WORKER (17<<20)
  47. #define STARPU_TAG_ONLY (18<<20)
  48. #define STARPU_POSSIBLY_PARALLEL (19<<20)
  49. struct starpu_task *starpu_task_build(struct starpu_codelet *cl, ...);
  50. int starpu_task_insert(struct starpu_codelet *cl, ...);
  51. /* the function starpu_insert_task has the same semantics as starpu_task_insert, it is kept to avoid breaking old codes */
  52. int starpu_insert_task(struct starpu_codelet *cl, ...);
  53. void starpu_codelet_unpack_args(void *cl_arg, ...);
  54. void starpu_codelet_pack_args(void **arg_buffer, size_t *arg_buffer_size, ...);
  55. #ifdef __cplusplus
  56. }
  57. #endif
  58. #endif /* __STARPU_TASK_UTIL_H__ */