[Openmp-commits] [openmp] r332360 - [OpenMP][libomptarget] Add function for checking SPMD mode

Gheorghe-Teodor Bercea via Openmp-commits openmp-commits at lists.llvm.org
Tue May 15 08:16:43 PDT 2018


Author: gbercea
Date: Tue May 15 08:16:43 2018
New Revision: 332360

URL: http://llvm.org/viewvc/llvm-project?rev=332360&view=rev
Log:
[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

Modified:
    openmp/trunk/libomptarget/deviceRTLs/nvptx/src/interface.h
    openmp/trunk/libomptarget/deviceRTLs/nvptx/src/omptarget-nvptx.cu

Modified: openmp/trunk/libomptarget/deviceRTLs/nvptx/src/interface.h
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/libomptarget/deviceRTLs/nvptx/src/interface.h?rev=332360&r1=332359&r2=332360&view=diff
==============================================================================
--- openmp/trunk/libomptarget/deviceRTLs/nvptx/src/interface.h (original)
+++ openmp/trunk/libomptarget/deviceRTLs/nvptx/src/interface.h Tue May 15 08:16:43 2018
@@ -516,4 +516,7 @@ EXTERN void __kmpc_data_sharing_environm
 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

Modified: openmp/trunk/libomptarget/deviceRTLs/nvptx/src/omptarget-nvptx.cu
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/libomptarget/deviceRTLs/nvptx/src/omptarget-nvptx.cu?rev=332360&r1=332359&r2=332360&view=diff
==============================================================================
--- openmp/trunk/libomptarget/deviceRTLs/nvptx/src/omptarget-nvptx.cu (original)
+++ openmp/trunk/libomptarget/deviceRTLs/nvptx/src/omptarget-nvptx.cu Tue May 15 08:16:43 2018
@@ -187,3 +187,8 @@ EXTERN void __kmpc_spmd_kernel_deinit()
         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();
+}




More information about the Openmp-commits mailing list