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);
50 #define _STARPU_JOB_UNSET ((struct _starpu_job *) NULL)
51 #define _STARPU_JOB_SETTING ((struct _starpu_job *) 1)
56 static inline struct _starpu_job *_starpu_get_job_associated_to_task(
struct starpu_task *
task)
61 if (STARPU_LIKELY(job != _STARPU_JOB_UNSET && job != _STARPU_JOB_SETTING))
74 int _starpu_handle_needs_conversion_task(starpu_data_handle_t handle,
77 _starpu_handle_needs_conversion_task_for_arch(starpu_data_handle_t handle,
78 enum starpu_node_kind node_kind);
85 void _starpu_task_prepare_for_continuation(
void);
87 void _starpu_task_set_omp_cleanup_callback(
struct starpu_task *
task,
void (*omp_cleanup_callback)(
void *arg),
88 void *omp_cleanup_callback_arg);
91 int _starpu_task_uses_multiformat_handles(
struct starpu_task *
task);
93 int _starpu_task_submit_conversion_task(
struct starpu_task *
task,
94 unsigned int workerid);
96 void _starpu_task_check_deprecated_fields(
struct starpu_task *
task);
97 void _starpu_codelet_check_deprecated_fields(
struct starpu_codelet *cl);
99 static inline starpu_cpu_func_t _starpu_task_get_cpu_nth_implementation(
struct starpu_codelet *cl,
unsigned nimpl)
101 return cl->cpu_funcs[
nimpl];
104 static inline starpu_cuda_func_t _starpu_task_get_cuda_nth_implementation(
struct starpu_codelet *cl,
unsigned nimpl)
106 return cl->cuda_funcs[
nimpl];
109 static inline starpu_opencl_func_t _starpu_task_get_opencl_nth_implementation(
struct starpu_codelet *cl,
unsigned nimpl)
111 return cl->opencl_funcs[
nimpl];
114 static inline starpu_mic_func_t _starpu_task_get_mic_nth_implementation(
struct starpu_codelet *cl,
unsigned nimpl)
116 return cl->mic_funcs[
nimpl];
119 static inline starpu_mpi_ms_func_t _starpu_task_get_mpi_ms_nth_implementation(
struct starpu_codelet *cl,
unsigned nimpl)
121 return cl->mpi_ms_funcs[
nimpl];
124 static inline const char *_starpu_task_get_cpu_name_nth_implementation(
struct starpu_codelet *cl,
unsigned nimpl)
126 return cl->cpu_funcs_name[
nimpl];
129 #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)
130 #define _STARPU_TASK_GET_INTERFACES(task) ((task->dyn_handles) ? task->dyn_interfaces : task->interfaces)
132 void _starpu_watchdog_init(
void);
133 void _starpu_watchdog_shutdown(
void);
135 int _starpu_task_wait_for_all_and_return_nb_waited_tasks(
void);
136 int _starpu_task_wait_for_all_in_ctx_and_return_nb_waited_tasks(
unsigned sched_ctx);
139 #ifdef BUILDING_STARPU
141 PRIO_LIST_CREATE_TYPE(starpu_task, priority);
#define LIST_CREATE_TYPE_NOSTRUCT(ENAME, _prev, _next)
Definition: list.h:187
void(* continuation_callback_on_sleep)(void *arg)
Definition: jobs.h:151
unsigned nimpl
Definition: jobs.h:188
unsigned continuation_resubmit
Definition: jobs.h:144
struct starpu_task * task
Definition: jobs.h:84
void _starpu_task_prepare_for_continuation_ext(unsigned continuation_resubmit, void(*continuation_callback_on_sleep)(void *arg), void *continuation_callback_on_sleep_arg)
void _starpu_task_init(void)
int _starpu_task_test_termination(struct starpu_task *task)
void _starpu_task_destroy(struct starpu_task *task)
struct _starpu_job * _starpu_get_job_associated_to_task_slow(struct starpu_task *task, struct _starpu_job *job)
int _starpu_task_submit_internally(struct starpu_task *task)