File tree Expand file tree Collapse file tree 4 files changed +12
-22
lines changed Expand file tree Collapse file tree 4 files changed +12
-22
lines changed Original file line number Diff line number Diff line change @@ -75,10 +75,6 @@ if(${LIBOMPTARGET_GPU_LIBC_SUPPORT})
7575 list (APPEND clang_opt_flags -DOMPTARGET_HAS_LIBC)
7676endif ()
7777
78- # Prepend -I to each list element
79- set (LIBOMPTARGET_LLVM_INCLUDE_DIRS_DEVICERTL "${LIBOMPTARGET_LLVM_INCLUDE_DIRS} " )
80- list (TRANSFORM LIBOMPTARGET_LLVM_INCLUDE_DIRS_DEVICERTL PREPEND "-I" )
81-
8278# Set flags for LLVM Bitcode compilation.
8379set (bc_flags -c -flto -std=c++17 -fvisibility=hidden
8480 ${clang_opt_flags} -nogpulib -nostdlibinc
@@ -88,7 +84,6 @@ set(bc_flags -c -flto -std=c++17 -fvisibility=hidden
8884 -I${include_directory}
8985 -I${devicertl_base_directory} /../include
9086 -I${devicertl_base_directory} /../../libc
91- ${LIBOMPTARGET_LLVM_INCLUDE_DIRS_DEVICERTL}
9287)
9388
9489# first create an object target
@@ -172,7 +167,6 @@ function(compileDeviceRTLLibrary target_name target_triple)
172167 ${include_directory}
173168 ${devicertl_base_directory} /../../libc
174169 ${devicertl_base_directory} /../include
175- ${LIBOMPTARGET_LLVM_INCLUDE_DIRS}
176170 )
177171 install (TARGETS ${ide_target_name} EXCLUDE_FROM_ALL )
178172 endif ()
Original file line number Diff line number Diff line change 2121#include " Synchronization.h"
2222#include " Workshare.h"
2323
24- #include " llvm/Frontend/OpenMP/OMPDeviceConstants.h"
25-
2624using namespace ompx ;
2725
26+ // These flags are copied from "llvm/Frontend/OpenMP/OMPDeviceConstants.h" and
27+ // must be kept in-sync.
28+ enum OMPTgtExecModeFlags : unsigned char {
29+ OMP_TGT_EXEC_MODE_GENERIC = 1 << 0 ,
30+ OMP_TGT_EXEC_MODE_SPMD = 1 << 1 ,
31+ OMP_TGT_EXEC_MODE_GENERIC_SPMD =
32+ OMP_TGT_EXEC_MODE_GENERIC | OMP_TGT_EXEC_MODE_SPMD
33+ };
34+
2835static void
2936inititializeRuntime (bool IsSPMD, KernelEnvironmentTy &KernelEnvironment,
3037 KernelLaunchEnvironmentTy &KernelLaunchEnvironment) {
@@ -74,8 +81,7 @@ extern "C" {
7481int32_t __kmpc_target_init (KernelEnvironmentTy &KernelEnvironment,
7582 KernelLaunchEnvironmentTy &KernelLaunchEnvironment) {
7683 ConfigurationEnvironmentTy &Configuration = KernelEnvironment.Configuration ;
77- bool IsSPMD = Configuration.ExecMode &
78- llvm::omp::OMPTgtExecModeFlags::OMP_TGT_EXEC_MODE_SPMD;
84+ bool IsSPMD = Configuration.ExecMode & OMP_TGT_EXEC_MODE_SPMD;
7985 bool UseGenericStateMachine = Configuration.UseGenericStateMachine ;
8086 if (IsSPMD) {
8187 inititializeRuntime (/* IsSPMD=*/ true , KernelEnvironment,
Original file line number Diff line number Diff line change 1616#include " State.h"
1717#include " gpuintrin.h"
1818
19- #include " llvm/Frontend/OpenMP/OMPGridValues.h"
20-
2119using namespace ompx ;
2220
2321// FIXME: This resolves the handling for the AMDGPU workgroup size when the ABI
Original file line number Diff line number Diff line change 1515
1616#include <stdint.h>
1717
18- #ifdef OMPTARGET_DEVICE_RUNTIME
19- #include "DeviceTypes.h"
20- #else
21- #include "SourceInfo.h"
22-
23- using IdentTy = ident_t ;
24- #endif
25-
26- #include "llvm/Frontend/OpenMP/OMPDeviceConstants.h"
18+ struct IdentTy ;
2719
2820enum class DeviceDebugKind : uint32_t {
2921 Assertion = 1U << 0 ,
@@ -80,7 +72,7 @@ struct DynamicEnvironmentTy {
8072struct ConfigurationEnvironmentTy {
8173 uint8_t UseGenericStateMachine = 2 ;
8274 uint8_t MayUseNestedParallelism = 2 ;
83- llvm :: omp :: OMPTgtExecModeFlags ExecMode = llvm :: omp :: OMP_TGT_EXEC_MODE_SPMD ;
75+ uint8_t ExecMode = 0 ;
8476 // Information about (legal) launch configurations.
8577 //{
8678 int32_t MinThreads = -1 ;
You can’t perform that action at this time.
0 commit comments