Changeset View
Changeset View
Standalone View
Standalone View
runtime/src/kmp_gsupport.cpp
Show First 20 Lines • Show All 912 Lines • ▼ Show 20 Lines | |||||
// | // | ||||
// Tasking constructs | // Tasking constructs | ||||
// | // | ||||
void | void | ||||
xexpand(KMP_API_NAME_GOMP_TASK)(void (*func)(void *), void *data, void (*copy_func)(void *, void *), | xexpand(KMP_API_NAME_GOMP_TASK)(void (*func)(void *), void *data, void (*copy_func)(void *, void *), | ||||
long arg_size, long arg_align, bool if_cond, unsigned gomp_flags) | long arg_size, long arg_align, bool if_cond, unsigned gomp_flags | ||||
#if OMP_40_ENABLED | |||||
, void **depend | |||||
Hahnfeld: `priority` is probably an OpenMP 4.5 thing? | |||||
Not Done ReplyInline ActionsRight, the priority is 4.5 addition, and we can add its implementation later if we want to. AndreyChurbanov: Right, the priority is 4.5 addition, and we can add its implementation later if we want to. | |||||
#endif | |||||
) | |||||
{ | { | ||||
MKLOC(loc, "GOMP_task"); | MKLOC(loc, "GOMP_task"); | ||||
int gtid = __kmp_entry_gtid(); | int gtid = __kmp_entry_gtid(); | ||||
kmp_int32 flags = 0; | kmp_int32 flags = 0; | ||||
kmp_tasking_flags_t *input_flags = (kmp_tasking_flags_t *) & flags; | kmp_tasking_flags_t *input_flags = (kmp_tasking_flags_t *) & flags; | ||||
KA_TRACE(20, ("GOMP_task: T#%d\n", gtid)); | KA_TRACE(20, ("GOMP_task: T#%d\n", gtid)); | ||||
Show All 27 Lines | if (arg_size > 0) { | ||||
(*copy_func)(task->shareds, data); | (*copy_func)(task->shareds, data); | ||||
} | } | ||||
else { | else { | ||||
KMP_MEMCPY(task->shareds, data, arg_size); | KMP_MEMCPY(task->shareds, data, arg_size); | ||||
} | } | ||||
} | } | ||||
if (if_cond) { | if (if_cond) { | ||||
#if OMP_40_ENABLED | |||||
if (gomp_flags & 8) { | |||||
KMP_ASSERT(depend); | |||||
const size_t ndeps = (kmp_intptr_t)depend[0]; | |||||
const size_t nout = (kmp_intptr_t)depend[1]; | |||||
kmp_depend_info_t dep_list[ndeps]; | |||||
for (size_t i = 0U; i < ndeps; i++) { | |||||
dep_list[i].base_addr = (kmp_intptr_t)depend[2U + i]; | |||||
dep_list[i].len = 0U; | |||||
if (i >= nout) { | |||||
dep_list[i].flags.in = 1; | |||||
dep_list[i].flags.out = 0; | |||||
} else { | |||||
dep_list[i].flags.in = 1; | |||||
dep_list[i].flags.out = 1; | |||||
} | |||||
} | |||||
__kmpc_omp_task_with_deps(&loc, gtid, task, ndeps, dep_list, 0, NULL); | |||||
} | |||||
else | |||||
#endif | |||||
__kmpc_omp_task(&loc, gtid, task); | __kmpc_omp_task(&loc, gtid, task); | ||||
} | } | ||||
else { | else { | ||||
#if OMPT_SUPPORT | #if OMPT_SUPPORT | ||||
ompt_thread_info_t oldInfo; | ompt_thread_info_t oldInfo; | ||||
kmp_info_t *thread; | kmp_info_t *thread; | ||||
kmp_taskdata_t *taskdata; | kmp_taskdata_t *taskdata; | ||||
if (ompt_enabled) { | if (ompt_enabled) { | ||||
▲ Show 20 Lines • Show All 649 Lines • Show Last 20 Lines |
priority is probably an OpenMP 4.5 thing?