[Openmp-commits] [PATCH] D105644: [libomptarget][nfc][devicertl] Split execution params

Jon Chesterfield via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Jul 8 10:54:00 PDT 2021


JonChesterfield updated this revision to Diff 357281.
JonChesterfield added a comment.

- typo


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105644/new/

https://reviews.llvm.org/D105644

Files:
  openmp/libomptarget/deviceRTLs/common/omptarget.h
  openmp/libomptarget/deviceRTLs/common/src/omp_data.cu
  openmp/libomptarget/deviceRTLs/common/src/omptarget.cu
  openmp/libomptarget/deviceRTLs/common/src/support.cu
  openmp/libomptarget/deviceRTLs/common/support.h


Index: openmp/libomptarget/deviceRTLs/common/support.h
===================================================================
--- openmp/libomptarget/deviceRTLs/common/support.h
+++ openmp/libomptarget/deviceRTLs/common/support.h
@@ -22,17 +22,14 @@
 enum ExecutionMode {
   Spmd = 0x00u,
   Generic = 0x01u,
-  ModeMask = 0x01u,
 };
 
 enum RuntimeMode {
   RuntimeInitialized = 0x00u,
   RuntimeUninitialized = 0x02u,
-  RuntimeMask = 0x02u,
 };
 
 void setExecutionParameters(ExecutionMode EMode, RuntimeMode RMode);
-bool isGenericMode();
 bool isRuntimeUninitialized();
 bool isRuntimeInitialized();
 
Index: openmp/libomptarget/deviceRTLs/common/src/support.cu
===================================================================
--- openmp/libomptarget/deviceRTLs/common/src/support.cu
+++ openmp/libomptarget/deviceRTLs/common/src/support.cu
@@ -20,19 +20,13 @@
 ////////////////////////////////////////////////////////////////////////////////
 
 void setExecutionParameters(ExecutionMode EMode, RuntimeMode RMode) {
-  execution_param = EMode;
-  execution_param |= RMode;
+  executionMode = EMode;
+  runtimeMode = RMode;
 }
 
-bool isGenericMode() { return (execution_param & ModeMask) == Generic; }
+bool isRuntimeUninitialized() { return runtimeMode == RuntimeUninitialized; }
 
-bool isRuntimeUninitialized() {
-  return (execution_param & RuntimeMask) == RuntimeUninitialized;
-}
-
-bool isRuntimeInitialized() {
-  return (execution_param & RuntimeMask) == RuntimeInitialized;
-}
+bool isRuntimeInitialized() { return !isRuntimeUninitialized(); }
 
 ////////////////////////////////////////////////////////////////////////////////
 // Execution Modes based on location parameter fields
Index: openmp/libomptarget/deviceRTLs/common/src/omptarget.cu
===================================================================
--- openmp/libomptarget/deviceRTLs/common/src/omptarget.cu
+++ openmp/libomptarget/deviceRTLs/common/src/omptarget.cu
@@ -161,8 +161,6 @@
 }
 
 // Return true if the current target region is executed in SPMD mode.
-EXTERN int8_t __kmpc_is_spmd_exec_mode() {
-  return (execution_param & ModeMask) == Spmd;
-}
+EXTERN int8_t __kmpc_is_spmd_exec_mode() { return executionMode == Spmd; }
 
 #pragma omp end declare target
Index: openmp/libomptarget/deviceRTLs/common/src/omp_data.cu
===================================================================
--- openmp/libomptarget/deviceRTLs/common/src/omp_data.cu
+++ openmp/libomptarget/deviceRTLs/common/src/omp_data.cu
@@ -55,7 +55,8 @@
 ////////////////////////////////////////////////////////////////////////////////
 // OpenMP kernel execution parameters
 ////////////////////////////////////////////////////////////////////////////////
-uint32_t SHARED(execution_param);
+uint16_t SHARED(executionMode);
+uint16_t SHARED(runtimeMode);
 
 ////////////////////////////////////////////////////////////////////////////////
 // Scratchpad for teams reduction.
Index: openmp/libomptarget/deviceRTLs/common/omptarget.h
===================================================================
--- openmp/libomptarget/deviceRTLs/common/omptarget.h
+++ openmp/libomptarget/deviceRTLs/common/omptarget.h
@@ -296,7 +296,9 @@
 extern omptarget_nvptx_ThreadPrivateContext *
     EXTERN_SHARED(omptarget_nvptx_threadPrivateContext);
 
-extern uint32_t EXTERN_SHARED(execution_param);
+extern uint16_t EXTERN_SHARED(executionMode);
+extern uint16_t EXTERN_SHARED(runtimeMode);
+
 extern void *EXTERN_SHARED(ReductionScratchpadPtr);
 
 ////////////////////////////////////////////////////////////////////////////////


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105644.357281.patch
Type: text/x-patch
Size: 3572 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210708/8c5e00b5/attachment-0001.bin>


More information about the Openmp-commits mailing list