kokkos: rename 'std' variant to 'cxxstd'. (#39319)

Co-authored-by: Cristian Di Pietrantonio <cdipietrantonio@pawsey.org.au>
This commit is contained in:
Cristian Di Pietrantonio 2023-08-11 15:18:02 +08:00 committed by GitHub
parent ea082539e4
commit 09ca71dbe0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 19 deletions

View file

@ -225,10 +225,10 @@ spack:
# GPU
- aml +ze
- amrex +sycl dimensions=3
- arborx +sycl ^kokkos +sycl +openmp std=17 +tests +examples
- cabana +sycl ^kokkos +sycl +openmp std=17 +tests +examples
- kokkos +sycl +openmp std=17 +tests +examples
- kokkos-kernels build_type=Release %oneapi ^kokkos +sycl +openmp std=17 +tests +examples
- arborx +sycl ^kokkos +sycl +openmp cxxstd=17 +tests +examples
- cabana +sycl ^kokkos +sycl +openmp cxxstd=17 +tests +examples
- kokkos +sycl +openmp cxxstd=17 +tests +examples
- kokkos-kernels build_type=Release %oneapi ^kokkos +sycl +openmp cxxstd=17 +tests +examples
# --
# - ginkgo +oneapi # InstallError: Ginkgo's oneAPI backend requires theDPC++ compiler as main CXX compiler.
# - hpctoolkit +level_zero # intel-tbb: icpx: error: unknown argument: '-flifetime-dse=1'

View file

@ -187,7 +187,7 @@ class Ascent(CMakePackage, CudaPackage):
depends_on("vtk-m+fpic", when="@0.8.0: +vtkh")
depends_on("vtk-m~shared+fpic", when="@0.8.0: +vtkh~shared")
# Ascent defaults to C++11
depends_on("kokkos std=11", when="+vtkh ^vtk-m +kokkos")
depends_on("kokkos cxxstd=11", when="+vtkh ^vtk-m +kokkos")
#######################
# VTK-h

View file

@ -42,7 +42,7 @@ class HpxKokkos(CMakePackage, CudaPackage, ROCmPackage):
for cxxstd in cxxstds:
depends_on("hpx cxxstd={0}".format(cxxstd), when="cxxstd={0}".format(cxxstd))
depends_on("kokkos std={0}".format(cxxstd), when="cxxstd={0}".format(cxxstd))
depends_on("kokkos cxxstd={0}".format(cxxstd), when="cxxstd={0}".format(cxxstd))
# HPXKokkos explicitly supports CUDA and ROCm. Other GPU backends can be
# used but without support in HPXKokkos. Other CPU backends, except Serial,

View file

@ -200,29 +200,30 @@ class Kokkos(CMakePackage, CudaPackage, ROCmPackage):
depends_on("kokkos-nvcc-wrapper@master", when="@master+wrapper")
conflicts("+wrapper", when="~cuda")
stds = ["11", "14", "17", "20"]
# TODO: This should be named cxxstd for consistency with other packages
variant("std", default="17", values=stds, multi=False, description="C++ standard")
cxxstds = ["11", "14", "17", "20"]
variant("cxxstd", default="17", values=cxxstds, multi=False, description="C++ standard")
variant("pic", default=False, description="Build position independent code")
conflicts("std=11", when="@3.7:")
conflicts("std=14", when="@4.0:")
conflicts("cxxstd=11", when="@3.7:")
conflicts("cxxstd=14", when="@4.0:")
conflicts("+cuda", when="std=17 ^cuda@:10")
conflicts("+cuda", when="std=20 ^cuda@:11")
conflicts("+cuda", when="cxxstd=17 ^cuda@:10")
conflicts("+cuda", when="cxxstd=20 ^cuda@:11")
# 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")
for cxxstdver in cxxstds[: cxxstds.index("17")]:
conflicts(
"+sycl", when="cxxstd={0}".format(cxxstdver), msg="SYCL requires C++17 or higher"
)
conflicts(
"+openmptarget",
when="std={0}".format(stdver),
when="cxxstd={0}".format(cxxstdver),
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))
for cxxstd in cxxstds:
depends_on("hpx cxxstd={0}".format(cxxstd), when="+hpx cxxstd={0}".format(cxxstd))
# HPX version constraints
depends_on("hpx@:1.6", when="@:3.5 +hpx")
@ -283,7 +284,7 @@ def cmake_args(self):
options = [
from_variant("CMAKE_POSITION_INDEPENDENT_CODE", "pic"),
from_variant("CMAKE_CXX_STANDARD", "std"),
from_variant("CMAKE_CXX_STANDARD", "cxxstd"),
from_variant("BUILD_SHARED_LIBS", "shared"),
]