commit | e0f19a44bc2c025d9a006fbc2bc4c329d9fd55f2 | [log] [tgz] |
---|---|---|
author | Gheorghe-Teodor Bercea <gheorghe-teod.bercea@ibm.com> | Tue May 15 15:16:43 2018 +0000 |
committer | Gheorghe-Teodor Bercea <gheorghe-teod.bercea@ibm.com> | Tue May 15 15:16:43 2018 +0000 |
tree | f44c0d6f6deff77a232a3897fcfa4c25d0544822 | |
parent | a838d8e95f40e21eabd704ec8e83a40405bc2c4c [diff] |
[OpenMP][libomptarget] Add function for checking SPMD mode Summary: Add function to the NVPTX libomptarget library that will return true if the current target region is being executed in SPMD mode. Reviewers: ABataev, grokos, carlo.bertolli, caomhin Reviewed By: grokos Subscribers: guansong, openmp-commits Differential Revision: https://reviews.llvm.org/D46840 git-svn-id: https://llvm.org/svn/llvm-project/openmp/trunk@332360 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/libomptarget/deviceRTLs/nvptx/src/interface.h b/libomptarget/deviceRTLs/nvptx/src/interface.h index 84f6ec6..a02d962 100644 --- a/libomptarget/deviceRTLs/nvptx/src/interface.h +++ b/libomptarget/deviceRTLs/nvptx/src/interface.h
@@ -516,4 +516,7 @@ EXTERN void * __kmpc_get_data_sharing_environment_frame(int32_t SourceThreadID, int16_t IsOMPRuntimeInitialized); + +// SPMD execution mode interrogation function. +EXTERN int8_t __kmpc_is_spmd_exec_mode(); #endif
diff --git a/libomptarget/deviceRTLs/nvptx/src/omptarget-nvptx.cu b/libomptarget/deviceRTLs/nvptx/src/omptarget-nvptx.cu index 4a86104..677654d 100644 --- a/libomptarget/deviceRTLs/nvptx/src/omptarget-nvptx.cu +++ b/libomptarget/deviceRTLs/nvptx/src/omptarget-nvptx.cu
@@ -187,3 +187,8 @@ omptarget_nvptx_threadPrivateContext); } } + +// Return true if the current target region is executed in SPMD mode. +EXTERN int8_t __kmpc_is_spmd_exec_mode() { + return isSPMDMode(); +}