diff options
Diffstat (limited to 'openmp/runtime/src')
-rw-r--r-- | openmp/runtime/src/dllexports | 1 | ||||
-rw-r--r-- | openmp/runtime/src/kmp.h | 13 | ||||
-rw-r--r-- | openmp/runtime/src/kmp_taskdeps.cpp | 25 | ||||
-rw-r--r-- | openmp/runtime/src/kmp_tasking.cpp | 22 |
4 files changed, 51 insertions, 10 deletions
diff --git a/openmp/runtime/src/dllexports b/openmp/runtime/src/dllexports index 0699e7596841..28d8371795ed 100644 --- a/openmp/runtime/src/dllexports +++ b/openmp/runtime/src/dllexports @@ -345,6 +345,7 @@ kmpc_set_defaults 224 __kmpc_fork_teams 241 __kmpc_omp_task_with_deps 242 __kmpc_omp_wait_deps 243 + __kmpc_omp_taskwait_deps_51 292 __kmpc_cancel 244 __kmpc_cancellationpoint 245 __kmpc_cancel_barrier 246 diff --git a/openmp/runtime/src/kmp.h b/openmp/runtime/src/kmp.h index 79d8e79c2999..f2d030f6b2dc 100644 --- a/openmp/runtime/src/kmp.h +++ b/openmp/runtime/src/kmp.h @@ -3973,6 +3973,10 @@ KMP_EXPORT void __kmpc_omp_task_complete_if0(ident_t *loc_ref, kmp_int32 gtid, KMP_EXPORT kmp_int32 __kmpc_omp_task_parts(ident_t *loc_ref, kmp_int32 gtid, kmp_task_t *new_task); KMP_EXPORT kmp_int32 __kmpc_omp_taskwait(ident_t *loc_ref, kmp_int32 gtid); +/* __kmpc_omp_taskwait_51 : Function for OpenMP 5.1 nowait clause. + * Placeholder for taskwait with nowait clause.*/ +KMP_EXPORT kmp_int32 __kmpc_omp_taskwait_51(ident_t *loc_ref, kmp_int32 gtid, + kmp_int32 has_no_wait); KMP_EXPORT kmp_int32 __kmpc_omp_taskyield(ident_t *loc_ref, kmp_int32 gtid, int end_part); @@ -3997,6 +4001,15 @@ KMP_EXPORT void __kmpc_omp_wait_deps(ident_t *loc_ref, kmp_int32 gtid, kmp_depend_info_t *dep_list, kmp_int32 ndeps_noalias, kmp_depend_info_t *noalias_dep_list); +/* __kmpc_omp_taskwait_deps_51 : Function for OpenMP 5.1 nowait clause. + * Placeholder for taskwait with nowait clause.*/ +KMP_EXPORT void __kmpc_omp_taskwait_deps_51(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 has_no_wait); + extern kmp_int32 __kmp_omp_task(kmp_int32 gtid, kmp_task_t *new_task, bool serialize_immediate); diff --git a/openmp/runtime/src/kmp_taskdeps.cpp b/openmp/runtime/src/kmp_taskdeps.cpp index 6c1d93a89183..5fcb84d0befa 100644 --- a/openmp/runtime/src/kmp_taskdeps.cpp +++ b/openmp/runtime/src/kmp_taskdeps.cpp @@ -744,10 +744,24 @@ Blocks the current task until all specifies dependences have been fulfilled. 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) { - KA_TRACE(10, ("__kmpc_omp_wait_deps(enter): T#%d loc=%p\n", gtid, loc_ref)); + __kmpc_omp_taskwait_deps_51(loc_ref, gtid, ndeps, dep_list, ndeps_noalias, + noalias_dep_list, false); +} +/* __kmpc_omp_taskwait_deps_51 : Function for OpenMP 5.1 nowait clause. + Placeholder for taskwait with nowait clause. + Earlier code of __kmpc_omp_wait_deps() is now + in this function. +*/ +void __kmpc_omp_taskwait_deps_51(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 has_no_wait) { + KA_TRACE(10, ("__kmpc_omp_taskwait_deps(enter): T#%d loc=%p nowait#%d\n", + gtid, loc_ref, has_no_wait)); if (ndeps == 0 && ndeps_noalias == 0) { - KA_TRACE(10, ("__kmpc_omp_wait_deps(exit): T#%d has no dependences to " + KA_TRACE(10, ("__kmpc_omp_taskwait_deps(exit): T#%d has no dependences to " "wait upon : loc=%p\n", gtid, loc_ref)); return; @@ -839,7 +853,7 @@ void __kmpc_omp_wait_deps(ident_t *loc_ref, kmp_int32 gtid, kmp_int32 ndeps, ignore = ignore || current_task->td_dephash == NULL; if (ignore) { - KA_TRACE(10, ("__kmpc_omp_wait_deps(exit): T#%d has no blocking " + KA_TRACE(10, ("__kmpc_omp_taskwait_deps(exit): T#%d has no blocking " "dependences : loc=%p\n", gtid, loc_ref)); #if OMPT_SUPPORT @@ -854,7 +868,7 @@ void __kmpc_omp_wait_deps(ident_t *loc_ref, kmp_int32 gtid, kmp_int32 ndeps, if (!__kmp_check_deps(gtid, &node, NULL, ¤t_task->td_dephash, DEP_BARRIER, ndeps, dep_list, ndeps_noalias, noalias_dep_list)) { - KA_TRACE(10, ("__kmpc_omp_wait_deps(exit): T#%d has no blocking " + KA_TRACE(10, ("__kmpc_omp_taskwait_deps(exit): T#%d has no blocking " "dependences : loc=%p\n", gtid, loc_ref)); #if OMPT_SUPPORT @@ -875,6 +889,7 @@ void __kmpc_omp_wait_deps(ident_t *loc_ref, kmp_int32 gtid, kmp_int32 ndeps, #if OMPT_SUPPORT __ompt_taskwait_dep_finish(current_task, taskwait_task_data); #endif /* OMPT_SUPPORT */ - KA_TRACE(10, ("__kmpc_omp_wait_deps(exit): T#%d finished waiting : loc=%p\n", + KA_TRACE(10, ("__kmpc_omp_taskwait_deps(exit): T#%d finished waiting : loc=%p\ + \n", gtid, loc_ref)); } diff --git a/openmp/runtime/src/kmp_tasking.cpp b/openmp/runtime/src/kmp_tasking.cpp index 1622c6aea10d..90e59b106733 100644 --- a/openmp/runtime/src/kmp_tasking.cpp +++ b/openmp/runtime/src/kmp_tasking.cpp @@ -2049,7 +2049,8 @@ kmp_int32 __kmp_omp_taskloop_task(ident_t *loc_ref, kmp_int32 gtid, template <bool ompt> static kmp_int32 __kmpc_omp_taskwait_template(ident_t *loc_ref, kmp_int32 gtid, void *frame_address, - void *return_address) { + void *return_address, + kmp_int32 has_no_wait) { kmp_taskdata_t *taskdata = nullptr; kmp_info_t *thread; int thread_finished = FALSE; @@ -2162,23 +2163,34 @@ static kmp_int32 __kmpc_omp_taskwait_template(ident_t *loc_ref, kmp_int32 gtid, OMPT_NOINLINE static kmp_int32 __kmpc_omp_taskwait_ompt(ident_t *loc_ref, kmp_int32 gtid, void *frame_address, - void *return_address) { + void *return_address, + kmp_int32 has_no_wait) { return __kmpc_omp_taskwait_template<true>(loc_ref, gtid, frame_address, - return_address); + return_address, has_no_wait); } #endif // OMPT_SUPPORT && OMPT_OPTIONAL // __kmpc_omp_taskwait: Wait until all tasks generated by the current task are // complete kmp_int32 __kmpc_omp_taskwait(ident_t *loc_ref, kmp_int32 gtid) { + return __kmpc_omp_taskwait_51(loc_ref, gtid, false); +} + +/* __kmpc_omp_taskwait_51 : Function for OpenMP 5.1 nowait clause. + * Placeholder for taskwait with nowait clause. + * The code is a copy of __kmpc_omp_taskwait.*/ +kmp_int32 __kmpc_omp_taskwait_51(ident_t *loc_ref, kmp_int32 gtid, + kmp_int32 has_no_wait) { #if OMPT_SUPPORT && OMPT_OPTIONAL if (UNLIKELY(ompt_enabled.enabled)) { OMPT_STORE_RETURN_ADDRESS(gtid); return __kmpc_omp_taskwait_ompt(loc_ref, gtid, OMPT_GET_FRAME_ADDRESS(0), - OMPT_LOAD_RETURN_ADDRESS(gtid)); + OMPT_LOAD_RETURN_ADDRESS(gtid), + has_no_wait); } #endif - return __kmpc_omp_taskwait_template<false>(loc_ref, gtid, NULL, NULL); + return __kmpc_omp_taskwait_template<false>(loc_ref, gtid, NULL, NULL, + has_no_wait); } // __kmpc_omp_taskyield: switch to a different task |