Lines Matching refs:task
477 static kmp_int32 __kmp_push_task(kmp_int32 gtid, kmp_task_t *task) { argument
479 kmp_taskdata_t *taskdata = KMP_TASK_TO_TASKDATA(task);
487 __kmpc_give_task(task, __kmp_tid_from_gtid(shadow_gtid));
528 if (taskdata->td_flags.priority_specified && task->data2.priority > 0 &&
530 int pri = KMP_MIN(task->data2.priority, __kmp_max_task_priority);
670 static void __kmp_task_start(kmp_int32 gtid, kmp_task_t *task, argument
672 kmp_taskdata_t *taskdata = KMP_TASK_TO_TASKDATA(task);
721 static inline void __ompt_task_init(kmp_taskdata_t *task, int tid) { argument
723 task->ompt_task_info.task_data.value = 0;
724 task->ompt_task_info.frame.exit_frame = ompt_data_none;
725 task->ompt_task_info.frame.enter_frame = ompt_data_none;
726 task->ompt_task_info.frame.exit_frame_flags =
728 task->ompt_task_info.frame.enter_frame_flags =
730 task->ompt_task_info.dispatch_chunk.start = 0;
731 task->ompt_task_info.dispatch_chunk.iterations = 0;
736 static inline void __ompt_task_start(kmp_task_t *task, argument
739 kmp_taskdata_t *taskdata = KMP_TASK_TO_TASKDATA(task);
756 static inline void __ompt_task_finish(kmp_task_t *task, argument
760 kmp_taskdata_t *taskdata = KMP_TASK_TO_TASKDATA(task);
776 kmp_task_t *task, argument
779 kmp_taskdata_t *taskdata = KMP_TASK_TO_TASKDATA(task);
798 __kmp_task_start(gtid, task, current_task);
816 __ompt_task_start(task, current_task, gtid);
827 kmp_task_t *task, argument
830 __kmpc_omp_task_begin_if0_template<true>(loc_ref, gtid, task, frame_address,
850 kmp_task_t *task) { argument
854 __kmpc_omp_task_begin_if0_ompt(loc_ref, gtid, task,
860 __kmpc_omp_task_begin_if0_template<false>(loc_ref, gtid, task, NULL, NULL);
866 void __kmpc_omp_task_begin(ident_t *loc_ref, kmp_int32 gtid, kmp_task_t *task) { argument
872 gtid, loc_ref, KMP_TASK_TO_TASKDATA(task), current_task));
874 __kmp_task_start(gtid, task, current_task);
877 loc_ref, KMP_TASK_TO_TASKDATA(task)));
900 kmp_task_t *task = KMP_TASKDATA_TO_TASK(taskdata); local
902 task->data1.destructors = NULL;
903 task->data2.priority = 0;
1037 static void __kmp_task_finish(kmp_int32 gtid, kmp_task_t *task, argument
1039 kmp_taskdata_t *taskdata = KMP_TASK_TO_TASKDATA(task);
1114 kmp_routine_entry_t destr_thunk = task->data1.destructors;
1116 destr_thunk(gtid, task);
1140 __ompt_task_finish(task, resumed_task, ompt_task_detach);
1160 __ompt_task_finish(task, resumed_task, ompt_task_switch);
1163 __kmpc_give_task(task, __kmp_tid_from_gtid(gtid));
1178 __ompt_task_finish(task, resumed_task, ompt_task_complete);
1256 kmp_task_t *task) { argument
1258 gtid, loc_ref, KMP_TASK_TO_TASKDATA(task)));
1261 __kmp_task_finish<ompt>(gtid, task, NULL);
1264 gtid, loc_ref, KMP_TASK_TO_TASKDATA(task)));
1282 kmp_task_t *task) { argument
1283 __kmpc_omp_task_complete_if0_template<true>(loc_ref, gtid, task);
1293 kmp_task_t *task) { argument
1296 __kmpc_omp_task_complete_if0_ompt(loc_ref, gtid, task);
1300 __kmpc_omp_task_complete_if0_template<false>(loc_ref, gtid, task);
1307 kmp_task_t *task) { argument
1309 loc_ref, KMP_TASK_TO_TASKDATA(task)));
1311 __kmp_task_finish<false>(gtid, task,
1315 loc_ref, KMP_TASK_TO_TASKDATA(task)));
1333 kmp_taskdata_t *task = &team->t.t_implicit_task_taskdata[tid]; local
1338 tid, team, task, set_curr_task ? "TRUE" : "FALSE"));
1340 task->td_task_id = KMP_GEN_TASK_ID();
1341 task->td_team = team;
1344 task->td_ident = loc_ref;
1345 task->td_taskwait_ident = NULL;
1346 task->td_taskwait_counter = 0;
1347 task->td_taskwait_thread = 0;
1349 task->td_flags.tiedness = TASK_TIED;
1350 task->td_flags.tasktype = TASK_IMPLICIT;
1351 task->td_flags.proxy = TASK_FULL;
1354 task->td_flags.task_serial = 1;
1355 task->td_flags.tasking_ser = (__kmp_tasking_mode == tskm_immediate_exec);
1356 task->td_flags.team_serial = (team->t.t_serialized) ? 1 : 0;
1358 task->td_flags.started = 1;
1359 task->td_flags.executing = 1;
1360 task->td_flags.complete = 0;
1361 task->td_flags.freed = 0;
1363 task->td_flags.onced = 0;
1366 task->td_depnode = NULL;
1367 task->td_last_tied = task;
1368 task->td_allow_completion_event.type = KMP_EVENT_UNINITIALIZED;
1371 KMP_ATOMIC_ST_REL(&task->td_incomplete_child_tasks, 0);
1373 KMP_ATOMIC_ST_REL(&task->td_allocated_child_tasks, 0);
1374 task->td_taskgroup = NULL; // An implicit task does not have taskgroup
1375 task->td_dephash = NULL;
1378 KMP_DEBUG_ASSERT(task->td_incomplete_child_tasks == 0);
1379 KMP_DEBUG_ASSERT(task->td_allocated_child_tasks == 0);
1384 __ompt_task_init(task, tid);
1388 team, task));
1397 kmp_taskdata_t *task = thread->th.th_current_task; local
1398 if (task->td_dephash) {
1400 task->td_flags.complete = 1;
1402 task->td_flags.onced = 1;
1404 children = KMP_ATOMIC_LD_ACQ(&task->td_incomplete_child_tasks);
1405 kmp_tasking_flags_t flags_old = task->td_flags;
1409 if (KMP_COMPARE_AND_STORE_ACQ32(RCAST(kmp_int32 *, &task->td_flags),
1414 thread->th.th_info.ds.ds_gtid, task));
1415 __kmp_dephash_free_entries(thread, task->td_dephash);
1426 kmp_taskdata_t *task = thread->th.th_current_task; local
1427 if (task && task->td_dephash) {
1428 __kmp_dephash_free(thread, task->td_dephash);
1429 task->td_dephash = NULL;
1461 kmp_task_t *task; local
1565 task = KMP_TASKDATA_TO_TASK(taskdata);
1570 KMP_DEBUG_ASSERT((((kmp_uintptr_t)task) & (sizeof(double) - 1)) == 0);
1573 KMP_DEBUG_ASSERT((((kmp_uintptr_t)task) & (sizeof(_Quad) - 1)) == 0);
1577 task->shareds = &((char *)taskdata)[shareds_offset];
1579 KMP_DEBUG_ASSERT((((kmp_uintptr_t)task->shareds) & (sizeof(void *) - 1)) ==
1582 task->shareds = NULL;
1584 task->routine = task_entry;
1585 task->part_id = 0; // AC: Always start with 0 part id
1682 return task;
1756 __kmp_invoke_task(kmp_int32 gtid, kmp_task_t *task, argument
1758 kmp_taskdata_t *taskdata = KMP_TASK_TO_TASKDATA(task);
1764 KMP_DEBUG_ASSERT(task);
1774 __kmp_bottom_half_finish_proxy(gtid, task);
1801 __kmp_task_start(gtid, task, current_task); // OMPT only if not discarded
1865 __ompt_task_start(task, current_task, gtid);
1910 if (task->routine != NULL) {
1913 ((void (*)(void *))(*(task->routine)))(task->shareds);
1917 (*(task->routine))(gtid, task);
1945 __kmp_task_finish<true>(gtid, task, current_task);
1948 __kmp_task_finish<false>(gtid, task, current_task);
1952 __ompt_task_finish(task, current_task, ompt_task_switch);
2057 new_record[i].task = nullptr;
2071 if (tdg->record_map[new_taskdata->td_task_id].task == nullptr) {
2072 tdg->record_map[new_taskdata->td_task_id].task = new_task;
3061 kmp_task_t *task = NULL; local
3154 task = KMP_TASKDATA_TO_TASK(taskdata);
3155 return task;
3162 kmp_task_t *task; local
3224 task = KMP_TASKDATA_TO_TASK(taskdata);
3225 return task;
3236 kmp_task_t *task; local
3358 task = KMP_TASKDATA_TO_TASK(taskdata);
3359 return task;
3378 kmp_task_t *task; local
3407 task = NULL;
3409 task = __kmp_get_priority_task(gtid, task_team, is_constrained);
3411 if (task == NULL && use_own_tasks) { // check own queue next
3412 task = __kmp_remove_my_task(thread, gtid, task_team, is_constrained);
3414 if ((task == NULL) && (nthreads > 1)) { // Steal a task finally
3465 task =
3469 if (task != NULL) { // set last stolen to victim
3483 if (task == NULL)
3496 __kmp_invoke_task(gtid, task, current_task);
4359 static bool __kmp_give_task(kmp_info_t *thread, kmp_int32 tid, kmp_task_t *task, argument
4361 kmp_taskdata_t *taskdata = KMP_TASK_TO_TASKDATA(task);
4602 kmp_task_t *task) { argument
4603 kmp_taskdata_t *td = KMP_TASK_TO_TASKDATA(task);
4606 td->td_allow_completion_event.ed.task = task;
4614 kmp_task_t *ptask = event->ed.task;
4672 kmp_task_t *task; local
4696 task = KMP_TASKDATA_TO_TASK(taskdata);
4708 if (task->shareds != NULL) { // need setup shareds pointer
4710 task->shareds = &((char *)taskdata)[shareds_offset];
4711 KMP_DEBUG_ASSERT((((kmp_uintptr_t)task->shareds) & (sizeof(void *) - 1)) ==
4742 return task;
4757 kmp_task_t *task; member in kmp_taskloop_bounds_t
4764 : task(_task), taskdata(KMP_TASK_TO_TASKDATA(task)),
4765 lower_offset((char *)lb - (char *)task),
4766 upper_offset((char *)ub - (char *)task) {
4771 : task(_task), taskdata(KMP_TASK_TO_TASKDATA(_task)),
4780 retval = *(kmp_int64 *)((char *)task + lower_offset);
4784 kmp_int32 *lb = RCAST(kmp_int32 *, task->shareds);
4787 kmp_int64 *lb = RCAST(kmp_int64 *, task->shareds);
4793 retval = *(kmp_int64 *)((char *)task + lower_offset);
4802 retval = *(kmp_int64 *)((char *)task + upper_offset);
4806 kmp_int32 *ub = RCAST(kmp_int32 *, task->shareds) + 1;
4809 kmp_int64 *ub = RCAST(kmp_int64 *, task->shareds) + 1;
4814 retval = *(kmp_int64 *)((char *)task + upper_offset);
4822 *(kmp_uint64 *)((char *)task + lower_offset) = lb;
4826 kmp_uint32 *lower = RCAST(kmp_uint32 *, task->shareds);
4829 kmp_uint64 *lower = RCAST(kmp_uint64 *, task->shareds);
4834 *(kmp_uint64 *)((char *)task + lower_offset) = lb;
4841 *(kmp_uint64 *)((char *)task + upper_offset) = ub;
4845 kmp_uint32 *upper = RCAST(kmp_uint32 *, task->shareds) + 1;
4848 kmp_uint64 *upper = RCAST(kmp_uint64 *, task->shareds) + 1;
4853 *(kmp_uint64 *)((char *)task + upper_offset) = ub;
4874 void __kmp_taskloop_linear(ident_t *loc, int gtid, kmp_task_t *task, argument
4887 kmp_taskloop_bounds_t task_bounds(task, lb, ub);
4936 next_task = __kmp_task_dup_alloc(thread, task, /* taskloop_recur */ 0);
4938 next_task = __kmp_task_dup_alloc(thread, task); // allocate new task
4954 ptask_dup(next_task, task, lastpriv);
4976 __kmp_task_start(gtid, task, current_task); // make internal bookkeeping
4978 __kmp_task_finish<false>(gtid, task, current_task);
4984 kmp_task_t *task; member
5014 kmp_task_t *task = p->task; local
5031 kmp_taskdata_t *taskdata = KMP_TASK_TO_TASKDATA(task);
5032 KMP_DEBUG_ASSERT(task != NULL);
5041 __kmp_taskloop_recur(NULL, gtid, task, lb, ub, st, ub_glob, num_tasks,
5048 __kmp_taskloop_linear(NULL, gtid, task, lb, ub, st, ub_glob, num_tasks,
5077 void __kmp_taskloop_recur(ident_t *loc, int gtid, kmp_task_t *task, argument
5087 kmp_taskdata_t *taskdata = KMP_TASK_TO_TASKDATA(task);
5088 KMP_DEBUG_ASSERT(task != NULL);
5101 (char *)lb - (char *)task; // remember offset of lb in the task structure
5103 (char *)ub - (char *)task; // remember offset of ub in the task structure
5138 next_task = __kmp_task_dup_alloc(thread, task,
5141 next_task = __kmp_task_dup_alloc(thread, task); // duplicate the task
5146 ptask_dup(next_task, task, 0);
5159 p->task = next_task;
5190 __kmp_taskloop_recur(loc, gtid, task, lb, ub, st, ub_glob, n_tsk0, gr_size0,
5197 __kmp_taskloop_linear(loc, gtid, task, lb, ub, st, ub_glob, n_tsk0,
5207 static void __kmp_taskloop(ident_t *loc, int gtid, kmp_task_t *task, int if_val, argument
5211 kmp_taskdata_t *taskdata = KMP_TASK_TO_TASKDATA(task);
5212 KMP_DEBUG_ASSERT(task != NULL);
5225 kmp_taskloop_bounds_t task_bounds(task, lb, ub);
5254 __kmp_task_start(gtid, task, current_task);
5256 __kmp_task_finish<false>(gtid, task, current_task);
5326 __kmp_taskloop_linear(loc, gtid, task, lb, ub, st, ub_glob, num_tasks,
5339 __kmp_taskloop_recur(loc, gtid, task, lb, ub, st, ub_glob, num_tasks,
5350 __kmp_taskloop_linear(loc, gtid, task, lb, ub, st, ub_glob, num_tasks,
5391 void __kmpc_taskloop(ident_t *loc, int gtid, kmp_task_t *task, int if_val, argument
5396 __kmp_taskloop(loc, gtid, task, if_val, lb, ub, st, nogroup, sched, grainsize,
5418 void __kmpc_taskloop_5(ident_t *loc, int gtid, kmp_task_t *task, int if_val, argument
5424 __kmp_taskloop(loc, gtid, task, if_val, lb, ub, st, nogroup, sched, grainsize,
5546 kmp_taskdata_t *td = KMP_TASK_TO_TASKDATA(this_record_map[j].task);
5571 __kmp_omp_task(gtid, this_record_map[this_root_tasks[j]].task, true);
5604 this_record_map[i].task = nullptr;