8#include <Kokkos_Core.hpp>
18 static constexpr const unsigned char SERIAL = 0x00;
19 static constexpr const unsigned char OPENMP = 0x01;
20 static constexpr const unsigned char THREADS = 0x02;
21 static constexpr const unsigned char CUDA = 0x03;
22 static constexpr const unsigned char HIP = 0x04;
23 static constexpr const unsigned char SYCL = 0x05;
30#if defined(KOKKOS_ENABLE_SERIAL)
33#if defined(KOKKOS_ENABLE_OPENMP)
36#if defined(KOKKOS_ENABLE_THREADS)
39#if defined(KOKKOS_ENABLE_CUDA)
42#if defined(KOKKOS_ENABLE_HIP)
45#if defined(KOKKOS_ENABLE_SYCL)
56#if defined(KOKKOS_ENABLE_SERIAL)
57 return Kokkos::Serial{};
59 std::cerr <<
"Kokkos::Serial is not enabled! Please recompile Kokkos with Kokkos_ENABLE_SERIAL!" << std::endl;
63#if defined(KOKKOS_ENABLE_OPENMP)
64 return Kokkos::OpenMP{};
66 std::cerr <<
"Kokkos::OpenMP is not enabled! Please recompile Kokkos with Kokkos_ENABLE_OPENMP!" << std::endl;
70#if defined(KOKKOS_ENABLE_THREADS)
71 return Kokkos::Threads{};
73 std::cerr <<
"Kokkos::Threads is not enabled! Please recompile Kokkos with Kokkos_ENABLE_THREADS!" << std::endl;
77#if defined(KOKKOS_ENABLE_CUDA)
78 return Kokkos::Cuda{};
80 std::cerr <<
"Kokkos::Cuda is not enabled! Please recompile Kokkos with Kokkos_ENABLE_CUDA!" << std::endl;
84#if defined(KOKKOS_ENABLE_HIP)
87 std::cerr <<
"Kokkos::HIP is not enabled! Please recompile Kokkos with Kokkos_ENABLE_HIP!" << std::endl;
91#if defined(KOKKOS_ENABLE_SYCL)
92 return Kokkos::SYCL{};
94 std::cerr <<
"Kokkos::SYCL is not enabled! Please recompile Kokkos with Kokkos_ENABLE_SYCL!" << std::endl;
98 std::cerr <<
"execspace: Serial, OpenMP, Threads, Cuda, HIP, SYCL" << std::endl;
std::variant< > AvailableExecSpaces
A type variant which defines the enabled Kokkos execution spaces.
static AvailableExecSpaces MakeExecSpace(const unsigned char s)
Converts an execution-space selector byte to a variant type.
Constants representing available Kokkos execution spaces as unsigned chars, usable both from C++ and ...
static constexpr const unsigned char OPENMP
static constexpr const unsigned char SERIAL
static constexpr const unsigned char SYCL
static constexpr const unsigned char THREADS
static constexpr const unsigned char HIP
static constexpr const unsigned char CUDA