Fix compatibility with Kokkos 4+
This commit is contained in:
parent
8b862f09b3
commit
893af9f5d0
@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2015-16 Tom Deakin, Simon McIntosh-Smith,
|
// Copyright (c) 2015-23 Tom Deakin, Simon McIntosh-Smith, Wei-Chen (Tom) Lin
|
||||||
// University of Bristol HPC
|
// University of Bristol HPC
|
||||||
//
|
//
|
||||||
// For full license terms please see the LICENSE file distributed with this
|
// For full license terms please see the LICENSE file distributed with this
|
||||||
|
|||||||
@ -10,9 +10,6 @@
|
|||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
#include <Kokkos_Core.hpp>
|
#include <Kokkos_Core.hpp>
|
||||||
#include <Kokkos_Parallel.hpp>
|
|
||||||
#include <Kokkos_View.hpp>
|
|
||||||
|
|
||||||
#include "Stream.h"
|
#include "Stream.h"
|
||||||
|
|
||||||
#define IMPLEMENTATION_STRING "Kokkos"
|
#define IMPLEMENTATION_STRING "Kokkos"
|
||||||
|
|||||||
@ -10,29 +10,29 @@ register_flag_optional(KOKKOS_IN_TREE
|
|||||||
See https://github.com/kokkos/kokkos/blob/master/BUILD.md for all available options" "")
|
See https://github.com/kokkos/kokkos/blob/master/BUILD.md for all available options" "")
|
||||||
|
|
||||||
register_flag_optional(KOKKOS_IN_PACKAGE
|
register_flag_optional(KOKKOS_IN_PACKAGE
|
||||||
"Use if Kokkos is part of a package dependency:
|
"Absolute path to package R-Path containing Kokkos libs.
|
||||||
Path to package R-Path containing Kokkos libs" "")
|
Use this instead of KOKKOS_IN_TREE if Kokkos is from a package manager like Spack." "")
|
||||||
|
|
||||||
# compiler vendor and arch specific flags
|
# compiler vendor and arch specific flags
|
||||||
set(KOKKOS_FLAGS_CPU_INTEL -qopt-streaming-stores=always)
|
set(KOKKOS_FLAGS_CPU_INTEL -qopt-streaming-stores=always)
|
||||||
|
|
||||||
macro(setup)
|
macro(setup)
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 14)
|
set(CMAKE_CXX_STANDARD 17) # Kokkos 4+ requires CXX >= 17
|
||||||
cmake_policy(SET CMP0074 NEW) #see https://github.com/kokkos/kokkos/blob/master/BUILD.md
|
cmake_policy(SET CMP0074 NEW) #see https://github.com/kokkos/kokkos/blob/master/BUILD.md
|
||||||
|
|
||||||
|
|
||||||
if (EXISTS "${KOKKOS_IN_TREE}")
|
if (EXISTS "${KOKKOS_IN_TREE}")
|
||||||
message(STATUS "Building using in-tree Kokkos source at `${KOKKOS_IN_TREE}`")
|
message(STATUS "Build using in-tree Kokkos source at `${KOKKOS_IN_TREE}`")
|
||||||
add_subdirectory(${KOKKOS_IN_TREE} ${CMAKE_BINARY_DIR}/kokkos)
|
add_subdirectory(${KOKKOS_IN_TREE} ${CMAKE_BINARY_DIR}/kokkos)
|
||||||
register_link_library(Kokkos::kokkos)
|
register_link_library(Kokkos::kokkos)
|
||||||
elseif (EXISTS "${KOKKOS_IN_PACKAGE}")
|
elseif (EXISTS "${KOKKOS_IN_PACKAGE}")
|
||||||
message(STATUS "Building using packaged Kokkos at `${KOKKOS_IN_PACKAGE}`")
|
message(STATUS "Build using packaged Kokkos at `${KOKKOS_IN_PACKAGE}`")
|
||||||
set (Kokkos_DIR "${KOKKOS_IN_PACKAGE}/lib64/cmake/Kokkos")
|
set (Kokkos_DIR "${KOKKOS_IN_PACKAGE}/lib64/cmake/Kokkos")
|
||||||
find_package(Kokkos REQUIRED)
|
find_package(Kokkos REQUIRED)
|
||||||
register_link_library(Kokkos::kokkos)
|
register_link_library(Kokkos::kokkos)
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "Neither `${KOKKOS_IN_TREE}`, or `${KOKKOS_IN_PACKAGE}` exists")
|
message(FATAL_ERROR "Neither `KOKKOS_IN_TREE`, or `KOKKOS_IN_PACKAGE` was set!")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
register_append_compiler_and_arch_specific_cxx_flags(
|
register_append_compiler_and_arch_specific_cxx_flags(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user