From 83e360a42720fee14e9886fb0c39d3dc9965a789 Mon Sep 17 00:00:00 2001 From: Jonathan Peyton Date: Wed, 26 Sep 2018 20:47:25 +0000 Subject: [PATCH] [OpenMP] Add missing __kmpc_critical_with_hint to dllexports This patch puts the __kmpc_critical_with_hint function in dllexports and also replaces some OMP_45_ENABLED to OMP_50_ENABLED Differential Revision: https://reviews.llvm.org/D52380 llvm-svn: 343143 --- openmp/runtime/src/dllexports | 5 +++-- openmp/runtime/src/kmp.h | 6 ++---- openmp/runtime/src/kmp_tasking.cpp | 9 +++------ 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/openmp/runtime/src/dllexports b/openmp/runtime/src/dllexports index baf6f54..59bda87 100644 --- a/openmp/runtime/src/dllexports +++ b/openmp/runtime/src/dllexports @@ -392,17 +392,18 @@ kmpc_set_defaults 224 __kmpc_doacross_post 263 __kmpc_doacross_fini 264 __kmpc_taskloop 266 + __kmpc_critical_with_hint 270 %endif %endif kmpc_aligned_malloc 265 kmpc_set_disp_num_buffers 267 # OpenMP 5.0 entry points -# TODO: change to OMP_50 once it is implemented %ifndef stub - %ifdef OMP_45 + %ifdef OMP_50 __kmpc_task_reduction_init 268 __kmpc_task_reduction_get_th_data 269 +# USED FOR 4.5 __kmpc_critical_with_hint 270 __kmpc_get_target_offload 271 %endif %endif diff --git a/openmp/runtime/src/kmp.h b/openmp/runtime/src/kmp.h index ce8fddf..fbb5ab8 100644 --- a/openmp/runtime/src/kmp.h +++ b/openmp/runtime/src/kmp.h @@ -2148,8 +2148,7 @@ typedef struct kmp_taskgroup { std::atomic cancel_request; // request for cancellation of this taskgroup struct kmp_taskgroup *parent; // parent taskgroup -// TODO: change to OMP_50_ENABLED, need to change build tools for this to work -#if OMP_45_ENABLED +#if OMP_50_ENABLED // Block of data to perform task reduction void *reduce_data; // reduction related info kmp_int32 reduce_num_data; // number of data items to reduce @@ -3769,8 +3768,7 @@ KMP_EXPORT void __kmpc_taskloop(ident_t *loc, kmp_int32 gtid, kmp_task_t *task, kmp_int32 sched, kmp_uint64 grainsize, void *task_dup); #endif -// TODO: change to OMP_50_ENABLED, need to change build tools for this to work -#if OMP_45_ENABLED +#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); #endif diff --git a/openmp/runtime/src/kmp_tasking.cpp b/openmp/runtime/src/kmp_tasking.cpp index 7179d2c..d2b5dde 100644 --- a/openmp/runtime/src/kmp_tasking.cpp +++ b/openmp/runtime/src/kmp_tasking.cpp @@ -1855,8 +1855,7 @@ kmp_int32 __kmpc_omp_taskyield(ident_t *loc_ref, kmp_int32 gtid, int end_part) { return TASK_CURRENT_NOT_QUEUED; } -// TODO: change to OMP_50_ENABLED, need to change build tools for this to work -#if OMP_45_ENABLED +#if OMP_50_ENABLED // Task Reduction implementation typedef struct kmp_task_red_flags { @@ -2059,8 +2058,7 @@ void __kmpc_taskgroup(ident_t *loc, int gtid) { KMP_ATOMIC_ST_RLX(&tg_new->count, 0); KMP_ATOMIC_ST_RLX(&tg_new->cancel_request, cancel_noreq); tg_new->parent = taskdata->td_taskgroup; -// TODO: change to OMP_50_ENABLED, need to change build tools for this to work -#if OMP_45_ENABLED +#if OMP_50_ENABLED tg_new->reduce_data = NULL; tg_new->reduce_num_data = 0; #endif @@ -2165,8 +2163,7 @@ void __kmpc_end_taskgroup(ident_t *loc, int gtid) { } KMP_DEBUG_ASSERT(taskgroup->count == 0); -// TODO: change to OMP_50_ENABLED, need to change build tools for this to work -#if OMP_45_ENABLED +#if OMP_50_ENABLED if (taskgroup->reduce_data != NULL) // need to reduce? __kmp_task_reduction_fini(thread, taskgroup); #endif -- 2.7.4