diff --git a/openmp/runtime/src/kmp_tasking.cpp b/openmp/runtime/src/kmp_tasking.cpp --- a/openmp/runtime/src/kmp_tasking.cpp +++ b/openmp/runtime/src/kmp_tasking.cpp @@ -1184,10 +1184,10 @@ // in task. // task_entry: Pointer to task code entry point generated by compiler. // returns: a pointer to the allocated kmp_task_t structure (task). -kmp_task_t *__kmp_task_alloc(ident_t *loc_ref, kmp_int32 gtid, - kmp_tasking_flags_t *flags, - size_t sizeof_kmp_task_t, size_t sizeof_shareds, - kmp_routine_entry_t task_entry) { +static inline kmp_task_t * +__kmp_task_alloc_impl(ident_t *loc_ref, kmp_int32 gtid, + kmp_tasking_flags_t *flags, size_t sizeof_kmp_task_t, + size_t sizeof_shareds, kmp_routine_entry_t task_entry) { kmp_task_t *task; kmp_taskdata_t *taskdata; kmp_info_t *thread = __kmp_threads[gtid]; @@ -1344,13 +1344,7 @@ if (flags->proxy == TASK_FULL) copy_icvs(&taskdata->td_icvs, &taskdata->td_parent->td_icvs); - taskdata->td_flags.tiedness = flags->tiedness; - taskdata->td_flags.final = flags->final; - taskdata->td_flags.merged_if0 = flags->merged_if0; - taskdata->td_flags.destructors_thunk = flags->destructors_thunk; - taskdata->td_flags.proxy = flags->proxy; - taskdata->td_flags.detachable = flags->detachable; - taskdata->td_flags.hidden_helper = flags->hidden_helper; + taskdata->td_flags = *flags; taskdata->encountering_gtid = gtid; taskdata->td_task_team = thread->th.th_task_team; taskdata->td_size_alloc = shareds_offset + sizeof_shareds; @@ -1375,8 +1369,6 @@ taskdata->td_flags.complete = 0; taskdata->td_flags.freed = 0; - taskdata->td_flags.native = flags->native; - KMP_ATOMIC_ST_RLX(&taskdata->td_incomplete_child_tasks, 0); // start at one because counts current task and children KMP_ATOMIC_ST_RLX(&taskdata->td_allocated_child_tasks, 1); @@ -1406,12 +1398,11 @@ if (taskdata->td_parent->td_flags.tasktype == TASK_EXPLICIT) { KMP_ATOMIC_INC(&taskdata->td_parent->td_allocated_child_tasks); } - } - - if (flags->hidden_helper) { - taskdata->td_flags.task_serial = FALSE; - // Increment the number of hidden helper tasks to be executed - KMP_ATOMIC_INC(&__kmp_unexecuted_hidden_helper_tasks); + if (flags->hidden_helper) { + taskdata->td_flags.task_serial = FALSE; + // Increment the number of hidden helper tasks to be executed + KMP_ATOMIC_INC(&__kmp_unexecuted_hidden_helper_tasks); + } } KA_TRACE(20, ("__kmp_task_alloc(exit): T#%d created task %p parent=%p\n", @@ -1421,6 +1412,14 @@ return task; } +kmp_task_t *__kmp_task_alloc(ident_t *loc_ref, kmp_int32 gtid, + kmp_tasking_flags_t *flags, + size_t sizeof_kmp_task_t, size_t sizeof_shareds, + kmp_routine_entry_t task_entry) { + return __kmp_task_alloc_impl(loc_ref, gtid, flags, sizeof_kmp_task_t, + sizeof_shareds, task_entry); +} + kmp_task_t *__kmpc_omp_task_alloc(ident_t *loc_ref, kmp_int32 gtid, kmp_int32 flags, size_t sizeof_kmp_task_t, size_t sizeof_shareds, @@ -1437,8 +1436,8 @@ input_flags->detachable ? "detachable" : "", sizeof_kmp_task_t, sizeof_shareds, task_entry)); - retval = __kmp_task_alloc(loc_ref, gtid, input_flags, sizeof_kmp_task_t, - sizeof_shareds, task_entry); + retval = __kmp_task_alloc_impl(loc_ref, gtid, input_flags, sizeof_kmp_task_t, + sizeof_shareds, task_entry); KA_TRACE(20, ("__kmpc_omp_task_alloc(exit): T#%d retval %p\n", gtid, retval));