Skip to content

Commit 4888c3d

Browse files
committed
Clean up basic kernels and CMakeLists.txt
1 parent f3f4a1b commit 4888c3d

22 files changed

Lines changed: 58 additions & 83 deletions

CMakeLists.txt

Lines changed: 40 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,24 @@ set(ENABLE_EXAMPLES Off CACHE BOOL "Enable RAJA examples")
2727
set(RAJA_ENABLE_EXERCISES Off CACHE BOOL "Enable RAJA exercises")
2828

2929
if(ENABLE_KOKKOS)
30-
set(CMAKE_CXX_STANDARD 14)
31-
set(BLT_CXX_STANDARD 14)
30+
set(CMAKE_CXX_STANDARD 17)
31+
set(BLT_CXX_STANDARD 17)
32+
else()
33+
set(CMAKE_CXX_STANDARD 11)
34+
set(BLT_CXX_STANDARD 11)
3235
endif()
36+
3337
include(blt/SetupBLT.cmake)
3438

39+
#
40+
# Define RAJA PERFSUITE settings...
41+
#
42+
43+
cmake_dependent_option(RAJA_PERFSUITE_ENABLE_MPI "Build with MPI" On "ENABLE_MPI" Off)
44+
3545
#
3646
# Define RAJA settings...
47+
#
3748

3849
set(ENABLE_TESTS Off CACHE BOOL "")
3950
set(ENABLE_EXAMPLES Off CACHE BOOL "")
@@ -54,8 +65,11 @@ add_subdirectory(tpl/RAJA)
5465
get_property(RAJA_INCLUDE_DIRS DIRECTORY tpl/RAJA PROPERTY INCLUDE_DIRECTORIES)
5566
include_directories(${RAJA_INCLUDE_DIRS})
5667

68+
5769
#
5870
# Setup variables to pass to Perf suite
71+
#
72+
5973
#
6074
# These (hopefully temporary) macro constants are needed to work-around
6175
# performance issues in the xl compiler.
@@ -73,6 +87,9 @@ set(RAJA_PERFSUITE_VERSION_PATCHLEVEL 0)
7387

7488
set(RAJA_PERFSUITE_DEPENDS RAJA)
7589

90+
if (RAJA_PERFSUITE_ENABLE_MPI)
91+
list(APPEND RAJA_PERFSUITE_DEPENDS mpi)
92+
endif()
7693
if (ENABLE_OPENMP)
7794
list(APPEND RAJA_PERFSUITE_DEPENDS openmp)
7895
endif()
@@ -81,7 +98,7 @@ if (ENABLE_CUDA)
8198
endif()
8299

83100
# Kokkos requires hipcc as the CMAKE_CXX_COMPILER for HIP AMD/VEGA GPU
84-
# platforms, whereas RAJAPerf Suite uses blt/CMake FindHIP to set HIP compiler
101+
# platforms, whereas RAJAPerf Suite uses blt/CMake FindHIP to set HIP compiler.
85102
# Separate RAJAPerf Suite and Kokkos handling of HIP compilers
86103

87104
if ((ENABLE_HIP) AND (NOT ENABLE_KOKKOS))
@@ -92,10 +109,16 @@ set(RAJAPERF_BUILD_SYSTYPE $ENV{SYS_TYPE})
92109
set(RAJAPERF_BUILD_HOST $ENV{HOSTNAME})
93110

94111
if (ENABLE_CUDA)
95-
if (ENABLE_CUDA AND ENABLE_KOKKOS)
96-
set(CMAKE_CUDA_STANDARD 14)
112+
set(CMAKE_CUDA_STANDARD 11)
113+
114+
# Kokkos Cuda handling
115+
if (ENABLE_KOKKOS)
116+
set(CMAKE_CUDA_STANDARD 17)
117+
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -restrict --extended-lambda --expt-relaxed-constexpr")
118+
else()
119+
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -restrict -arch ${CUDA_ARCH} --expt-extended-lambda --expt-relaxed-constexpr")
97120
endif()
98-
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -restrict -arch ${CUDA_ARCH} --expt-extended-lambda --expt-relaxed-constexpr")
121+
99122
set(RAJAPERF_COMPILER "${CUDA_NVCC_EXECUTABLE}")
100123
list(APPEND RAJAPERF_COMPILER ${CMAKE_CXX_COMPILER})
101124
set(RAJAPERF_COMPILER_OPTIONS "${CUDA_NVCC_FLAGS}")
@@ -115,44 +138,41 @@ configure_file(${CMAKE_SOURCE_DIR}/src/rajaperf_config.hpp.in
115138

116139
include_directories($<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/bin>)
117140

118-
# Make sure RAJA flags propagate (we need to do some tidying to
141+
# Make sure RAJA flags propagate (we need to do some tidying to
119142
# remove project-specific CMake variables that are no longer needed)
120143
set (CUDA_NVCC_FLAGS ${RAJA_NVCC_FLAGS})
121144

145+
#
146+
# Each directory in the perf suite has its own CMakeLists.txt file.
147+
#
148+
122149
# The statement below is required for Kokkos compilation.
123150
if(ENABLE_KOKKOS)
124151
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/tpl/RAJA/include/)
125152
endif()
126153

127-
128154
# ENABLE_KOKKOS is A RAJAPerf Suite Option
129155
if(ENABLE_KOKKOS)
130156
add_definitions(-DRUN_KOKKOS)
131157
if(ENABLE_HIP)
132158
set(Kokkos_ENABLE_HIP ON CACHE BOOL "Kokkos builds for AMD HIP set the
133-
Kokkos_ENABLE_HIP variable to ON")
134-
#set(Kokkos_ARCH_VEGA900 ON CACHE BOOL "Docstring") #TODO: better
159+
Kokkos_ENABLE_HIP variable to ON")
135160
endif()
161+
136162
if(ENABLE_TARGET_OPENMP)
137-
set(Kokkos_ENABLE_OPENMPTARGET ON CACHE BOOL "Docstring")
138-
set(Kokkos_ARCH_VOLTA70 ON CACHE BOOL "Docstring") #TODO: better
139-
set(CMAKE_CXX_STANDARD 17)
140-
set(BLT_CXX_STANDARD 17)
163+
set(Kokkos_ENABLE_OPENMPTARGET ON CACHE BOOL "Docstring")
141164
set(RAJA_ENABLE_TARGET_OPENMP ON CACHE BOOL "Docstring")
142165
if(NOT CMAKE_BUILD_TYPE MATCHES Debug)
143166
if(NOT EXPERIMENTAL_BUILD)
144-
message(FATAL_ERROR "Kokkos builds with OpenMPTarget require a Debug build to succeed at the moment. Rebuild with CMAKE_BUILD_TYPE=Debug. If you're a compiler developer, rebuild with -DEXPERIMENTAL_BUILD=ON")
167+
message(FATAL_ERROR "Kokkos builds with OpenMPTarget require a Debug build to succeed at the moment. Rebuild with CMAKE_BUILD_TYPE=Debug. If you're a compiler developer, rebuild with -DEXPERIMENTAL_BUILD=ON")
145168
endif()
146169
endif()
147-
148-
#add_definitions(-DRAJA_ENABLE_TARGET_OPENMP)
149170
endif()
150171

151172
# ENABLE_CUDA IS A RAJA PERFSUITE OPTION
152173
if(ENABLE_CUDA)
153-
set(Kokkos_ENABLE_CUDA ON CACHE BOOL "Docstring")
154-
set(Kokkos_ENABLE_CUDA_LAMBDA ON CACHE BOOL "Docstring")
155-
set(Kokkos_ARCH_VOLTA70 ON CACHE BOOL "Docstring") #TODO: better
174+
set(Kokkos_ENABLE_CUDA ON CACHE BOOL "Docstring")
175+
set(Kokkos_ENABLE_CUDA_LAMBDA ON CACHE BOOL "Docstring")
156176
enable_language(CUDA)
157177
endif()
158178
if(ENABLE_OPENMP)
@@ -162,7 +182,6 @@ Kokkos_ENABLE_HIP variable to ON")
162182
add_subdirectory(tpl/kokkos)
163183
get_property(KOKKOS_INCLUDE_DIRS DIRECTORY tpl/kokkos PROPERTY INCLUDE_DIRECTORIES)
164184
include_directories(${KOKKOS_INCLUDE_DIRS})
165-
166185
list(APPEND RAJA_PERFSUITE_DEPENDS kokkos)
167186
endif()
168187

src/basic/DAXPY.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ class DAXPY : public KernelBase
5252
void runCudaVariant(VariantID vid);
5353
void runHipVariant(VariantID vid);
5454
void runOpenMPTargetVariant(VariantID vid);
55-
5655
void runKokkosVariant(VariantID vid);
5756

5857
private:

src/basic/IF_QUAD.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ IF_QUAD::IF_QUAD(const RunParams& params)
3737

3838
setUsesFeature(Forall);
3939

40-
41-
setVariantDefined( Kokkos_Lambda );
42-
43-
4440
setVariantDefined( Base_Seq );
4541
setVariantDefined( Lambda_Seq );
4642
setVariantDefined( RAJA_Seq );
@@ -59,6 +55,8 @@ IF_QUAD::IF_QUAD(const RunParams& params)
5955
setVariantDefined( Base_HIP );
6056
setVariantDefined( Lambda_HIP );
6157
setVariantDefined( RAJA_HIP );
58+
59+
setVariantDefined( Kokkos_Lambda );
6260
}
6361

6462
IF_QUAD::~IF_QUAD()

src/basic/IF_QUAD.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,7 @@ class IF_QUAD : public KernelBase
6969
void runCudaVariant(VariantID vid);
7070
void runHipVariant(VariantID vid);
7171
void runOpenMPTargetVariant(VariantID vid);
72-
7372
void runKokkosVariant(VariantID vid);
74-
75-
76-
7773

7874
private:
7975
Real_ptr m_a;

src/basic/INIT3.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,23 @@ INIT3::INIT3(const RunParams& params)
3636
setVariantDefined( Base_Seq );
3737
setVariantDefined( Lambda_Seq );
3838
setVariantDefined( RAJA_Seq );
39-
setVariantDefined( Kokkos_Lambda );
4039

4140
setVariantDefined( Base_OpenMP );
4241
setVariantDefined( Lambda_OpenMP );
4342
setVariantDefined( RAJA_OpenMP );
4443

45-
4644
setVariantDefined( Base_OpenMPTarget );
4745
setVariantDefined( RAJA_OpenMPTarget );
4846

4947
setVariantDefined( Base_CUDA );
5048
setVariantDefined( Lambda_CUDA );
5149
setVariantDefined( RAJA_CUDA );
5250

53-
5451
setVariantDefined( Base_HIP );
5552
setVariantDefined( Lambda_HIP );
5653
setVariantDefined( RAJA_HIP );
54+
55+
setVariantDefined( Kokkos_Lambda );
5756
}
5857

5958
INIT3::~INIT3()

src/basic/INIT3.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,7 @@ class INIT3 : public KernelBase
5555
void runCudaVariant(VariantID vid);
5656
void runHipVariant(VariantID vid);
5757
void runOpenMPTargetVariant(VariantID vid);
58-
5958
void runKokkosVariant(VariantID vid);
60-
61-
62-
6359

6460
private:
6561
Real_ptr m_out1;

src/basic/INIT_VIEW1D.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@ INIT_VIEW1D::INIT_VIEW1D(const RunParams& params)
5454
setVariantDefined( RAJA_HIP );
5555

5656
setVariantDefined( Kokkos_Lambda );
57-
58-
59-
6057
}
6158

6259
INIT_VIEW1D::~INIT_VIEW1D()

src/basic/INIT_VIEW1D.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,8 @@ class INIT_VIEW1D : public KernelBase
6666
void runCudaVariant(VariantID vid);
6767
void runHipVariant(VariantID vid);
6868
void runOpenMPTargetVariant(VariantID vid);
69-
void runKokkosVariant(VariantID vid);
70-
71-
72-
69+
void runKokkosVariant(VariantID vid);
70+
7371
private:
7472
Real_ptr m_a;
7573
Real_type m_val;

src/basic/INIT_VIEW1D_OFFSET.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@ INIT_VIEW1D_OFFSET::INIT_VIEW1D_OFFSET(const RunParams& params)
5454
setVariantDefined( RAJA_HIP );
5555

5656
setVariantDefined( Kokkos_Lambda );
57-
58-
59-
6057
}
6158

6259
INIT_VIEW1D_OFFSET::~INIT_VIEW1D_OFFSET()

src/basic/INIT_VIEW1D_OFFSET.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,8 @@ class INIT_VIEW1D_OFFSET : public KernelBase
6565
void runCudaVariant(VariantID vid);
6666
void runHipVariant(VariantID vid);
6767
void runOpenMPTargetVariant(VariantID vid);
68-
void runKokkosVariant(VariantID vid);
69-
70-
71-
68+
void runKokkosVariant(VariantID vid);
69+
7270
private:
7371
Real_ptr m_a;
7472
Real_type m_val;

0 commit comments

Comments
 (0)