[Openmp-commits] [PATCH] D46840: [OpenMP][libomptarget] Add function for checking SPMD mode

Gheorghe-Teodor Bercea via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon May 14 12:16:55 PDT 2018


gtbercea created this revision.
gtbercea added reviewers: ABataev, grokos, carlo.bertolli, caomhin.
Herald added subscribers: openmp-commits, guansong.

Add function to the NVPTX libomptarget library that will return true if the current target region is being executed in SPMD mode.


Repository:
  rOMP OpenMP

https://reviews.llvm.org/D46840

Files:
  libomptarget/deviceRTLs/nvptx/src/interface.h
  libomptarget/deviceRTLs/nvptx/src/omptarget-nvptx.cu


Index: libomptarget/deviceRTLs/nvptx/src/omptarget-nvptx.cu
===================================================================
--- libomptarget/deviceRTLs/nvptx/src/omptarget-nvptx.cu
+++ 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 bool __kmpc_is_spmd_exec_mode(){
+  return isSPMDMode();
+}
\ No newline at end of file
Index: libomptarget/deviceRTLs/nvptx/src/interface.h
===================================================================
--- libomptarget/deviceRTLs/nvptx/src/interface.h
+++ libomptarget/deviceRTLs/nvptx/src/interface.h
@@ -491,6 +491,9 @@
 EXTERN void __kmpc_end_sharing_variables();
 EXTERN void __kmpc_get_shared_variables(void ***GlobalArgs);
 
+// SPMD execution mode interrogation function.
+EXTERN bool __kmpc_is_spmd_exec_mode();
+
 // The slot used for data sharing by the master and worker threads. We use a
 // complete (default size version and an incomplete one so that we allow sizes
 // greater than the default).


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46840.146651.patch
Type: text/x-patch
Size: 1117 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20180514/8f4654b7/attachment.bin>


More information about the Openmp-commits mailing list