hpx, kokkos: add consistent variants for C++ std (#25535)
* Add cuda_constexpr variant to Kokkos package * Don't require nvcc_wrapper in Kokkos package when using Cray compiler
This commit is contained in:
parent
c0069210e2
commit
819cd41ee4
@ -35,7 +35,7 @@ class Hpx(CMakePackage, CudaPackage):
|
||||
|
||||
variant('cxxstd',
|
||||
default='17',
|
||||
values=('11', '14', '17'),
|
||||
values=('11', '14', '17', '20'),
|
||||
description='Use the specified C++ standard when building.')
|
||||
|
||||
variant(
|
||||
|
@ -17,7 +17,7 @@ class Kokkos(CMakePackage, CudaPackage, ROCmPackage):
|
||||
|
||||
test_requires_compiler = True
|
||||
|
||||
maintainers = ['jjwilke', 'jciesko']
|
||||
maintainers = ['DavidPoliakoff', 'jciesko']
|
||||
|
||||
version('master', branch='master')
|
||||
version('develop', branch='develop')
|
||||
@ -53,6 +53,8 @@ class Kokkos(CMakePackage, CudaPackage, ROCmPackage):
|
||||
'Aggressively vectorize loops'],
|
||||
'compiler_warnings': [False,
|
||||
'Print all compiler warnings'],
|
||||
'cuda_constexpr': [False,
|
||||
'Activate experimental constexpr features'],
|
||||
'cuda_lambda': [False,
|
||||
'Activate experimental lambda features'],
|
||||
'cuda_ldg_intrinsic': [False,
|
||||
@ -193,13 +195,18 @@ class Kokkos(CMakePackage, CudaPackage, ROCmPackage):
|
||||
depends_on("kokkos-nvcc-wrapper@master", when="@master+wrapper")
|
||||
conflicts("+wrapper", when="~cuda")
|
||||
|
||||
variant("std", default="14", values=["11", "14", "17", "20"], multi=False)
|
||||
stds = ["11", "14", "17", "20"]
|
||||
variant("std", default="14", values=stds, multi=False)
|
||||
variant("pic", default=False, description="Build position independent code")
|
||||
|
||||
# nvcc does not currently work with C++17 or C++20
|
||||
conflicts("+cuda", when="std=17 ^cuda@:10.99.99")
|
||||
conflicts("+cuda", when="std=20")
|
||||
|
||||
# HPX should use the same C++ standard
|
||||
for std in stds:
|
||||
depends_on('hpx cxxstd={0}'.format(std), when='+hpx std={0}'.format(std))
|
||||
|
||||
variant('shared', default=True, description='Build shared libraries')
|
||||
|
||||
def append_args(self, cmake_prefix, cmake_options, spack_options):
|
||||
@ -229,7 +236,9 @@ def setup_dependent_package(self, module, dependent_spec):
|
||||
def cmake_args(self):
|
||||
spec = self.spec
|
||||
|
||||
if spec.satisfies('~wrapper+cuda') and not spec.satisfies('%clang'):
|
||||
if spec.satisfies("~wrapper+cuda") and not (
|
||||
spec.satisfies("%clang") or spec.satisfies("%cce")
|
||||
):
|
||||
raise InstallError("Kokkos requires +wrapper when using +cuda"
|
||||
"without clang")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user