From 54ea1f4bf66437fc9534b8beaf439feefa3c50b5 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Tue, 24 May 2022 17:23:47 -0400 Subject: Allow Kokkos with OpenMPTarget backend (#30724) * Allow Kokkos with OpenMPTarget backend * Restrict SYCL and OpenMPTarget to C++17 or higher * Improve C++ standard check for SYCL and OpenMPTarget * Fix indentation --- var/spack/repos/builtin/packages/kokkos/package.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/var/spack/repos/builtin/packages/kokkos/package.py b/var/spack/repos/builtin/packages/kokkos/package.py index b8e5083425..9c624aa76a 100644 --- a/var/spack/repos/builtin/packages/kokkos/package.py +++ b/var/spack/repos/builtin/packages/kokkos/package.py @@ -46,9 +46,11 @@ class Kokkos(CMakePackage, CudaPackage, ROCmPackage): 'serial': [True, 'Whether to build serial backend'], 'rocm': [False, 'Whether to build HIP backend'], 'sycl': [False, 'Whether to build the SYCL backend'], + 'openmptarget': [False, 'Whether to build the OpenMPTarget backend'] } conflicts("+rocm", when="@:3.0") conflicts("+sycl", when="@:3.3") + conflicts("+openmptarget", when="@:3.5") # https://github.com/spack/spack/issues/29052 conflicts("@:3.5.00 +sycl", when="%dpcpp@2022.0.0") @@ -194,6 +196,13 @@ class Kokkos(CMakePackage, CudaPackage, ROCmPackage): conflicts("+cuda", when="std=17 ^cuda@:10") conflicts("+cuda", when="std=20") + # SYCL and OpenMPTarget require C++17 or higher + for stdver in stds[:stds.index('17')]: + conflicts('+sycl', when='std={0}'.format(stdver), + msg='SYCL requires C++17 or higher') + conflicts("+openmptarget", when='std={0}'.format(stdver), + msg='OpenMPTarget requires C++17 or higher') + # HPX should use the same C++ standard for std in stds: depends_on('hpx cxxstd={0}'.format(std), when='+hpx std={0}'.format(std)) -- cgit v1.2.3-60-g2f50