LLVM OpenMP 22.0.0git
Tasking support

These functions support tasking constructs. More...

Functions

kmp_int32 __kmpc_omp_task_with_deps (ident_t *loc_ref, kmp_int32 gtid, kmp_task_t *new_task, kmp_int32 ndeps, kmp_depend_info_t *dep_list, kmp_int32 ndeps_noalias, kmp_depend_info_t *noalias_dep_list)
void __kmpc_omp_wait_deps (ident_t *loc_ref, kmp_int32 gtid, kmp_int32 ndeps, kmp_depend_info_t *dep_list, kmp_int32 ndeps_noalias, kmp_depend_info_t *noalias_dep_list)
kmp_int32 __kmpc_omp_reg_task_with_affinity (ident_t *loc_ref, kmp_int32 gtid, kmp_task_t *new_task, kmp_int32 naffins, kmp_task_affinity_info_t *affin_list)
void__kmpc_task_reduction_init (int gtid, int num, void *data)
void__kmpc_taskred_init (int gtid, int num, void *data)
void__kmpc_task_reduction_get_th_data (int gtid, void *tskgrp, void *data)
void__kmpc_task_reduction_modifier_init (ident_t *loc, int gtid, int is_ws, int num, void *data)
void__kmpc_taskred_modifier_init (ident_t *loc, int gtid, int is_ws, int num, void *data)
void __kmpc_task_reduction_modifier_fini (ident_t *loc, int gtid, int is_ws)
void __kmpc_proxy_task_completed (kmp_int32 gtid, kmp_task_t *ptask)
void __kmpc_proxy_task_completed_ooo (kmp_task_t *ptask)
void __kmpc_taskloop (ident_t *loc, int gtid, kmp_task_t *task, int if_val, kmp_uint64 *lb, kmp_uint64 *ub, kmp_int64 st, int nogroup, int sched, kmp_uint64 grainsize, void *task_dup)
void __kmpc_taskloop_5 (ident_t *loc, int gtid, kmp_task_t *task, int if_val, kmp_uint64 *lb, kmp_uint64 *ub, kmp_int64 st, int nogroup, int sched, kmp_uint64 grainsize, int modifier, void *task_dup)
void ** __kmpc_omp_get_target_async_handle_ptr (kmp_int32 gtid)
bool __kmpc_omp_has_task_team (kmp_int32 gtid)

Detailed Description

These functions support tasking constructs.

Function Documentation

◆ __kmpc_omp_get_target_async_handle_ptr()

void ** __kmpc_omp_get_target_async_handle_ptr ( kmp_int32 gtid)
Parameters
gtidGlobal Thread ID of current thread
Returns
Returns a pointer to the thread's current task async handle. If no task is present or gtid is invalid, returns NULL.

Acqurires a pointer to the target async handle from the current task.

Definition at line 5200 of file kmp_tasking.cpp.

References __kmp_thread_from_gtid(), kmp_target_data::async_handle, KMP_GTID_DNE, and kmp_taskdata::td_target_data.

◆ __kmpc_omp_has_task_team()

bool __kmpc_omp_has_task_team ( kmp_int32 gtid)
Parameters
gtidGlobal Thread ID of current thread
Returns
Returns TRUE if the current task being executed of the given thread has a task team allocated to it. Otherwise, returns FALSE.

Checks if the current thread has a task team.

Definition at line 5221 of file kmp_tasking.cpp.

References __kmp_thread_from_gtid(), FALSE, KMP_GTID_DNE, and kmp_taskdata::td_task_team.

◆ __kmpc_omp_reg_task_with_affinity()

kmp_int32 __kmpc_omp_reg_task_with_affinity ( ident_t * loc_ref,
kmp_int32 gtid,
kmp_task_t * new_task,
kmp_int32 naffins,
kmp_task_affinity_info_t * affin_list )
Parameters
loc_reflocation of the original task directive
gtidGlobal Thread ID of encountering thread
new_tasktask thunk allocated by __kmpc_omp_task_alloc() for the ''new task''
naffinsNumber of affinity items
affin_listList of affinity items
Returns
Returns non-zero if registering affinity information was not successful. Returns 0 if registration was successful This entry registers the affinity information attached to a task with the task thunk structure kmp_taskdata_t.

Definition at line 1505 of file kmp_tasking.cpp.

◆ __kmpc_omp_task_with_deps()

kmp_int32 __kmpc_omp_task_with_deps ( ident_t * loc_ref,
kmp_int32 gtid,
kmp_task_t * new_task,
kmp_int32 ndeps,
kmp_depend_info_t * dep_list,
kmp_int32 ndeps_noalias,
kmp_depend_info_t * noalias_dep_list )
Parameters
loc_reflocation of the original task directive
gtidGlobal Thread ID of encountering thread
new_tasktask thunk allocated by __kmp_omp_task_alloc() for the ''new task''
ndepsNumber of depend items with possible aliasing
dep_listList of depend items with possible aliasing
ndeps_noaliasNumber of depend items with no aliasing
noalias_dep_listList of depend items with no aliasing
Returns
Returns either TASK_CURRENT_NOT_QUEUED if the current task was not suspended and queued, or TASK_CURRENT_QUEUED if it was suspended and queued

Schedule a non-thread-switchable task with dependences for execution

Definition at line 684 of file kmp_taskdeps.cpp.

References __kmp_acquire_bootstrap_lock(), __kmp_allocate, __kmp_assert_valid_gtid(), __kmp_check_deps(), __kmp_dephash_create(), __kmp_free, __kmp_init_node(), __kmp_omp_task(), __kmp_release_bootstrap_lock(), __kmp_thread_malloc, __kmp_threads, kmp_depend_info::all, kmp_tasking_flags::final, kmp_depend_info::flags, i, kmp_depend_info::in, KA_TRACE, KMP_ASSERT, KMP_ATOMIC_INC, KMP_ATOMIC_ST_REL, KMP_MEMCPY, KMP_SIZE_T_MAX, KMP_TASK_TO_TASKDATA, kmp_depend_info::mtx, new_size, NO_DEP_BARRIER, ompt_callbacks, ompt_enabled, OMPT_GET_FRAME_ADDRESS, kmp_depend_info::out, ret, kmp_depend_info::set, TASK_CURRENT_NOT_QUEUED, TASK_TYPE_DETAILS_FORMAT, kmp_tasking_flags::tasking_ser, kmp_taskdata::td_dephash, kmp_taskdata::td_depnode, kmp_taskdata::td_flags, kmp_taskdata::td_parent, kmp_tasking_flags::team_serial, kmp_task_team::tt, kmp_base_task_team::tt_found_proxy_tasks, and kmp_base_task_team::tt_hidden_helper_task_encountered.

Referenced by main(), main(), and main().

◆ __kmpc_omp_wait_deps()

void __kmpc_omp_wait_deps ( ident_t * loc_ref,
kmp_int32 gtid,
kmp_int32 ndeps,
kmp_depend_info_t * dep_list,
kmp_int32 ndeps_noalias,
kmp_depend_info_t * noalias_dep_list )
Parameters
loc_reflocation of the original task directive
gtidGlobal Thread ID of encountering thread
ndepsNumber of depend items with possible aliasing
dep_listList of depend items with possible aliasing
ndeps_noaliasNumber of depend items with no aliasing
noalias_dep_listList of depend items with no aliasing

Blocks the current task until all specifies dependences have been fulfilled.

Definition at line 895 of file kmp_taskdeps.cpp.

References __kmpc_omp_taskwait_deps_51().

Referenced by KMP_API_NAME_GOMP_TASKWAIT_DEPEND().

◆ __kmpc_proxy_task_completed()

void __kmpc_proxy_task_completed ( kmp_int32 gtid,
kmp_task_t * ptask )
Parameters
gtidGlobal Thread ID of encountering thread
ptaskTask which execution is completed

Execute the completion of a proxy task from a thread of that is part of the team. Run first and bottom halves directly.

Definition at line 4280 of file kmp_tasking.cpp.

References __kmp_assert_valid_gtid(), __kmp_bottom_half_finish_proxy(), __kmp_first_top_half_finish_proxy(), __kmp_second_top_half_finish_proxy(), KA_TRACE, KMP_DEBUG_ASSERT, KMP_TASK_TO_TASKDATA, kmp_tasking_flags::proxy, TASK_PROXY, and kmp_taskdata::td_flags.

Referenced by __kmp_fulfill_event().

◆ __kmpc_proxy_task_completed_ooo()

void __kmpc_proxy_task_completed_ooo ( kmp_task_t * ptask)
Parameters
ptaskTask which execution is completed

Execute the completion of a proxy task from a thread that could not belong to the team.

Definition at line 4344 of file kmp_tasking.cpp.

References __kmp_first_top_half_finish_proxy(), __kmp_second_top_half_finish_proxy(), __kmpc_give_task(), KA_TRACE, KMP_DEBUG_ASSERT, KMP_TASK_TO_TASKDATA, kmp_tasking_flags::proxy, TASK_PROXY, and kmp_taskdata::td_flags.

Referenced by __kmp_fulfill_event(), and target().

◆ __kmpc_task_reduction_get_th_data()

void * __kmpc_task_reduction_get_th_data ( int gtid,
void * tskgrp,
void * data )
Parameters
gtidGlobal thread ID
tskgrpThe taskgroup ID (optional)
dataShared location of the item
Returns
The pointer to per-thread data

Get thread-specific location of data item

Definition at line 2436 of file kmp_tasking.cpp.

References __kmp_allocate, __kmp_assert_valid_gtid(), __kmp_threads, arr, data, i, j, KMP_ASSERT, KMP_ASSERT2, kmp_taskgroup::parent, kmp_taskgroup::reduce_data, kmp_taskgroup::reduce_num_data, and void.

Referenced by main().

◆ __kmpc_task_reduction_init()

void * __kmpc_task_reduction_init ( int gtid,
int num,
void * data )
Parameters
gtidGlobal thread ID
numNumber of data items to reduce
dataArray of data for reduction
Returns
The taskgroup identifier

Initialize task reduction for the taskgroup.

Note: this entry supposes the optional compiler-generated initializer routine has single parameter - pointer to object to be initialized. That means the reduction either does not use omp_orig object, or the omp_orig is accessible without help of the runtime library.

Definition at line 2366 of file kmp_tasking.cpp.

References __kmp_allocate, __kmp_task_reduction_init(), data, and KMP_MEMCPY.

Referenced by main().

◆ __kmpc_task_reduction_modifier_fini()

void __kmpc_task_reduction_modifier_fini ( ident_t * loc,
int gtid,
int is_ws )
Parameters
locSource location info
gtidGlobal thread ID
is_wsIs 1 if the reduction is for worksharing, 0 otherwise

Finalize task reduction for a parallel or worksharing.

Definition at line 2649 of file kmp_tasking.cpp.

References __kmpc_end_taskgroup(), and loc.

◆ __kmpc_task_reduction_modifier_init()

void * __kmpc_task_reduction_modifier_init ( ident_t * loc,
int gtid,
int is_ws,
int num,
void * data )
Parameters
locSource location info
gtidGlobal thread ID
is_wsIs 1 if the reduction is for worksharing, 0 otherwise
numNumber of data items to reduce
dataArray of data for reduction
Returns
The taskgroup identifier

Initialize task reduction for a parallel or worksharing.

Note: this entry supposes the optional compiler-generated initializer routine has single parameter - pointer to object to be initialized. That means the reduction either does not use omp_orig object, or the omp_orig is accessible without help of the runtime library.

Definition at line 2615 of file kmp_tasking.cpp.

References __kmp_task_reduction_modifier_init(), data, and loc.

◆ __kmpc_taskloop()

void __kmpc_taskloop ( ident_t * loc,
int gtid,
kmp_task_t * task,
int if_val,
kmp_uint64 * lb,
kmp_uint64 * ub,
kmp_int64 st,
int nogroup,
int sched,
kmp_uint64 grainsize,
void * task_dup )
Parameters
locSource location information
gtidGlobal thread ID
taskTask structure
if_valValue of the if clause
lbPointer to loop lower bound in task structure
ubPointer to loop upper bound in task structure
stLoop stride
nogroupFlag, 1 if nogroup clause specified, 0 otherwise
schedSchedule specified 0/1/2 for none/grainsize/num_tasks
grainsizeSchedule value if specified
task_dupTasks duplication routine

Execute the taskloop construct.

Definition at line 5154 of file kmp_tasking.cpp.

References __kmp_assert_valid_gtid(), __kmp_taskloop(), KA_TRACE, and loc.

◆ __kmpc_taskloop_5()

void __kmpc_taskloop_5 ( ident_t * loc,
int gtid,
kmp_task_t * task,
int if_val,
kmp_uint64 * lb,
kmp_uint64 * ub,
kmp_int64 st,
int nogroup,
int sched,
kmp_uint64 grainsize,
int modifier,
void * task_dup )
Parameters
locSource location information
gtidGlobal thread ID
taskTask structure
if_valValue of the if clause
lbPointer to loop lower bound in task structure
ubPointer to loop upper bound in task structure
stLoop stride
nogroupFlag, 1 if nogroup clause specified, 0 otherwise
schedSchedule specified 0/1/2 for none/grainsize/num_tasks
grainsizeSchedule value if specified
modifierModifier 'strict' for sched, 1 if present, 0 otherwise
task_dupTasks duplication routine

Execute the taskloop construct.

Definition at line 5181 of file kmp_tasking.cpp.

References __kmp_assert_valid_gtid(), __kmp_taskloop(), KA_TRACE, and loc.

◆ __kmpc_taskred_init()

void * __kmpc_taskred_init ( int gtid,
int num,
void * data )
Parameters
gtidGlobal thread ID
numNumber of data items to reduce
dataArray of data for reduction
Returns
The taskgroup identifier

Initialize task reduction for the taskgroup.

Note: this entry supposes the optional compiler-generated initializer routine has two parameters, pointer to object to be initialized and pointer to omp_orig

Definition at line 2393 of file kmp_tasking.cpp.

References __kmp_allocate, __kmp_task_reduction_init(), data, and KMP_MEMCPY.

◆ __kmpc_taskred_modifier_init()

void * __kmpc_taskred_modifier_init ( ident_t * loc,
int gtid,
int is_ws,
int num,
void * data )
Parameters
locSource location info
gtidGlobal thread ID
is_wsIs 1 if the reduction is for worksharing, 0 otherwise
numNumber of data items to reduce
dataArray of data for reduction
Returns
The taskgroup identifier

Initialize task reduction for a parallel or worksharing.

Note: this entry supposes the optional compiler-generated initializer routine has two parameters, pointer to object to be initialized and pointer to omp_orig

Definition at line 2635 of file kmp_tasking.cpp.

References __kmp_task_reduction_modifier_init(), data, and loc.