diff options
| author | Jonathan Peyton <jonathan.l.peyton@intel.com> | 2018-11-29 20:04:29 +0000 |
|---|---|---|
| committer | Jonathan Peyton <jonathan.l.peyton@intel.com> | 2018-11-29 20:04:29 +0000 |
| commit | b04f7d681aa47194fe1b7d0888b2ef50ea18d71e (patch) | |
| tree | 8282aa5cd5fb845d64081cbfb9a2edb60b82447b /openmp | |
| parent | 0b8dd4488e961b074cac76b952769286b4834393 (diff) | |
| download | bcm5719-llvm-b04f7d681aa47194fe1b7d0888b2ef50ea18d71e.tar.gz bcm5719-llvm-b04f7d681aa47194fe1b7d0888b2ef50ea18d71e.zip | |
[OpenMP] Add stubs for Task affinity API
This patch adds __kmpc_omp_reg_task_with_affinity to register affinity
information for tasks. For now, the affinity information is not used,
and the function always succeeds. This also adds the kmp_task_affinity_info_t
structure to store the task affinity information.
Patch by Terry Wilmarth
Differential Revision: https://reviews.llvm.org/D55026
llvm-svn: 347907
Diffstat (limited to 'openmp')
| -rw-r--r-- | openmp/runtime/src/dllexports | 1 | ||||
| -rw-r--r-- | openmp/runtime/src/kmp.h | 15 | ||||
| -rw-r--r-- | openmp/runtime/src/kmp_tasking.cpp | 22 |
3 files changed, 38 insertions, 0 deletions
diff --git a/openmp/runtime/src/dllexports b/openmp/runtime/src/dllexports index 920e049631b..ffc20a1a336 100644 --- a/openmp/runtime/src/dllexports +++ b/openmp/runtime/src/dllexports @@ -405,6 +405,7 @@ kmpc_set_disp_num_buffers 267 __kmpc_task_reduction_get_th_data 269 # USED FOR 4.5 __kmpc_critical_with_hint 270 __kmpc_get_target_offload 271 + __kmpc_omp_reg_task_with_affinity 272 %endif %endif diff --git a/openmp/runtime/src/kmp.h b/openmp/runtime/src/kmp.h index 7aac0af83b4..91db8d44996 100644 --- a/openmp/runtime/src/kmp.h +++ b/openmp/runtime/src/kmp.h @@ -2222,6 +2222,18 @@ typedef struct kmp_dephash { #endif } kmp_dephash_t; +#if OMP_50_ENABLED +typedef struct kmp_task_affinity_info { + kmp_intptr_t base_addr; + size_t len; + struct { + bool flag1 : 1; + bool flag2 : 1; + kmp_int32 reserved : 30; + } flags; +} kmp_task_affinity_info_t; +#endif + #endif #ifdef BUILD_TIED_TASK_STACK @@ -3783,6 +3795,9 @@ KMP_EXPORT void __kmpc_taskloop(ident_t *loc, kmp_int32 gtid, kmp_task_t *task, #if OMP_50_ENABLED KMP_EXPORT void *__kmpc_task_reduction_init(int gtid, int num_data, void *data); KMP_EXPORT void *__kmpc_task_reduction_get_th_data(int gtid, void *tg, void *d); +KMP_EXPORT 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); #endif #endif diff --git a/openmp/runtime/src/kmp_tasking.cpp b/openmp/runtime/src/kmp_tasking.cpp index 2d7468659c5..daf5ad2db1c 100644 --- a/openmp/runtime/src/kmp_tasking.cpp +++ b/openmp/runtime/src/kmp_tasking.cpp @@ -1392,6 +1392,28 @@ kmp_task_t *__kmpc_omp_task_alloc(ident_t *loc_ref, kmp_int32 gtid, return retval; } +#if OMP_50_ENABLED +/*! +@ingroup TASKING +@param loc_ref location of the original task directive +@param gtid Global Thread ID of encountering thread +@param new_task task thunk allocated by __kmpc_omp_task_alloc() for the ''new +task'' +@param naffins Number of affinity items +@param affin_list List of affinity items +@return 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. +*/ +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) { + return 0; +} +#endif + // __kmp_invoke_task: invoke the specified task // // gtid: global thread ID of caller |

