17 #ifndef __CORE_TASK_H__
18 #define __CORE_TASK_H__
23 #include <common/config.h>
39 void _starpu_task_deinit(
void);
40 void _starpu_set_current_task(
struct starpu_task *
task);
46 int _starpu_task_submit_nodeps(
struct starpu_task *
task);
48 void _starpu_task_declare_deps_array(
struct starpu_task *
task,
unsigned ndeps,
struct starpu_task *task_array[],
int check);
57 if (STARPU_UNLIKELY(!job))
60 task->starpu_private = job;
69 int _starpu_handle_needs_conversion_task(starpu_data_handle_t handle,
72 _starpu_handle_needs_conversion_task_for_arch(starpu_data_handle_t handle,
73 enum starpu_node_kind node_kind);
80 void _starpu_task_prepare_for_continuation(
void);
82 void _starpu_task_set_omp_cleanup_callback(
struct starpu_task *
task,
void (*omp_cleanup_callback)(
void *arg),
83 void *omp_cleanup_callback_arg);
86 int _starpu_task_uses_multiformat_handles(
struct starpu_task *
task);
88 int _starpu_task_submit_conversion_task(
struct starpu_task *
task,
89 unsigned int workerid);
91 void _starpu_task_check_deprecated_fields(
struct starpu_task *
task);
92 void _starpu_codelet_check_deprecated_fields(
struct starpu_codelet *cl);
94 static inline starpu_cpu_func_t _starpu_task_get_cpu_nth_implementation(
struct starpu_codelet *cl,
unsigned nimpl)
96 return cl->cpu_funcs[
nimpl];
99 static inline starpu_cuda_func_t _starpu_task_get_cuda_nth_implementation(
struct starpu_codelet *cl,
unsigned nimpl)
101 return cl->cuda_funcs[
nimpl];
104 static inline starpu_opencl_func_t _starpu_task_get_opencl_nth_implementation(
struct starpu_codelet *cl,
unsigned nimpl)
106 return cl->opencl_funcs[
nimpl];
109 static inline starpu_mic_func_t _starpu_task_get_mic_nth_implementation(
struct starpu_codelet *cl,
unsigned nimpl)
111 return cl->mic_funcs[
nimpl];
114 static inline starpu_mpi_ms_func_t _starpu_task_get_mpi_ms_nth_implementation(
struct starpu_codelet *cl,
unsigned nimpl)
116 return cl->mpi_ms_funcs[
nimpl];
119 static inline const char *_starpu_task_get_cpu_name_nth_implementation(
struct starpu_codelet *cl,
unsigned nimpl)
121 return cl->cpu_funcs_name[
nimpl];
124 #define _STARPU_TASK_SET_INTERFACE(task, interface, i) do { if (task->dyn_handles) task->dyn_interfaces[i] = interface; else task->interfaces[i] = interface;} while(0)
125 #define _STARPU_TASK_GET_INTERFACES(task) ((task->dyn_handles) ? task->dyn_interfaces : task->interfaces)
127 void _starpu_watchdog_init(
void);
128 void _starpu_watchdog_shutdown(
void);
130 int _starpu_task_wait_for_all_and_return_nb_waited_tasks(
void);
131 int _starpu_task_wait_for_all_in_ctx_and_return_nb_waited_tasks(
unsigned sched_ctx);
134 #ifdef BUILDING_STARPU
136 PRIO_LIST_CREATE_TYPE(starpu_task, priority);
139 #endif // __CORE_TASK_H__