From f6fca3ac065b0416417829a4ed48db1235bd7b8b Mon Sep 17 00:00:00 2001 From: Tom Deakin Date: Thu, 12 May 2016 12:30:06 +0100 Subject: [PATCH] Add Kokkos building to CMake config --- CMakeLists.txt | 11 +++++++++-- KokkosMakefile | 10 ++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 KokkosMakefile diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d10c40..8501add 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -105,8 +105,15 @@ endif () #------------------------------------------------------------------------------- # Kokkos #------------------------------------------------------------------------------- - -# TODO +if (BUILD_KOKKOS) + if ("${CMAKE_SYSTEM_NAME}" MATCHES "Linux") + add_custom_target(gpu-stream-kokkos COMMAND make -f KokkosMakefile) + else() + message("Skipping Kokkos (requires Linux)") + endif() +else() + message("Skipping Kokkos... (use -DBUILD_KOKKOS=1 to opt in)") +endif() #------------------------------------------------------------------------------- # SYCL diff --git a/KokkosMakefile b/KokkosMakefile new file mode 100644 index 0000000..2d08bc9 --- /dev/null +++ b/KokkosMakefile @@ -0,0 +1,10 @@ + +default: gpu-stream-kokkos + +include /modules/modules/kokkos/Makefile.kokkos + +gpu-stream-kokkos: main.o KOKKOSStream.o + $(CXX) $(KOKKOS_LDFLAGS) $^ $(KOKKOS_LIBS) -o $@ -DKOKKOS + +%.o:%.cpp $(KOKKOS_CPP_DEPENDS) + $(NVCC_WRAPPER) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) -c $< -DKOKKOS