Skip to content

Commit 7e86ceb

Browse files
committed
spack: remove openmp and cuda variants
Inherits however kokkos was configured.
1 parent 87a4869 commit 7e86ceb

File tree

2 files changed

+9
-15
lines changed

2 files changed

+9
-15
lines changed

.gitlab-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ before_script:
8989
- |
9090
if [[ ${CI_JOB_NAME} =~ "a100" ]];
9191
then
92-
export SPINER_SPACK_SPEC="${SPINER_SPACK_SPEC}+hdf5+mpi+kokkos+cuda cuda_arch=80";
92+
export SPINER_SPACK_SPEC="${SPINER_SPACK_SPEC}+hdf5+mpi+kokkos ^kokkos+cuda cuda_arch=80";
9393
fi
9494
- |
9595
if [[ "${CI_COMMIT_BRANCH}" == "${CI_DEFAULT_BRANCH}" ]];

spack-repo/packages/spiner/package.py

+8-14
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from spack.package import *
77

88

9-
class Spiner(CMakePackage, CudaPackage):
9+
class Spiner(CMakePackage):
1010
"""Spiner:
1111
Performance portable routines for generic, tabulated, multi-dimensional data"""
1212

@@ -44,7 +44,6 @@ class Spiner(CMakePackage, CudaPackage):
4444
default=False,
4545
description="Enable kokkos",
4646
)
47-
variant("openmp", default=False, description="Enable openmp kokkos backend")
4847

4948
variant("hdf5", default=False, description="Enable hdf5")
5049
variant("mpi", default=False, description="Support parallel hdf5")
@@ -64,13 +63,9 @@ class Spiner(CMakePackage, CudaPackage):
6463
# Currently the raw cuda backend of ports-of-call is not supported.
6564
depends_on("ports-of-call portability_strategy=Kokkos", when="@:1.5.1 +kokkos")
6665
depends_on("ports-of-call portability_strategy=None", when="@:1.5.1 ~kokkos")
67-
for _flag in list(CudaPackage.cuda_arch_values):
68-
depends_on("[email protected]: cuda_arch=" + _flag, when="+cuda+kokkos cuda_arch=" + _flag)
69-
for _flag in ("~cuda", "+cuda", "~openmp", "+openmp"):
70-
depends_on("[email protected]: " + _flag, when="+kokkos" + _flag)
7166
depends_on(
72-
"[email protected]: ~shared+wrapper+cuda_lambda+cuda_constexpr",
73-
when="+cuda+kokkos",
67+
"[email protected]: ~shared+cuda_lambda+cuda_constexpr",
68+
when="+kokkos ^kokkos+cuda",
7469
)
7570

7671
depends_on("hdf5+hl~mpi", when="+hdf5~mpi")
@@ -81,9 +76,6 @@ class Spiner(CMakePackage, CudaPackage):
8176
depends_on("py-matplotlib", when="+python")
8277

8378
conflicts("+mpi", when="~hdf5")
84-
conflicts("+cuda", when="~kokkos")
85-
conflicts("+openmp", when="~kokkos")
86-
conflicts("cuda_arch=none", when="+cuda", msg="CUDA architecture is required")
8779

8880
def cmake_args(self):
8981
if self.spec.satisfies("@1.6.0:"):
@@ -93,14 +85,16 @@ def cmake_args(self):
9385
use_kokkos_option = "SPINER_USE_KOKKOS"
9486
use_cuda_option = "SPINER_USE_CUDA"
9587

88+
use_cuda = self.spec.satisfies("^kokkos+cuda")
89+
9690
args = [
9791
self.define("BUILD_TESTING", self.run_tests),
9892
self.define_from_variant(use_kokkos_option, "kokkos"),
99-
self.define_from_variant(use_cuda_option, "cuda"),
93+
self.define(use_cuda_option, use_cuda),
10094
self.define_from_variant("SPINER_USE_HDF", "hdf5"),
10195
]
102-
if "+cuda" in self.spec:
96+
if use_cuda:
10397
args.append(
104-
self.define("CMAKE_CUDA_ARCHITECTURES", self.spec.variants["cuda_arch"].value)
98+
self.define("CMAKE_CUDA_ARCHITECTURES", self.spec["kokkos"].variants["cuda_arch"].value)
10599
)
106100
return args

0 commit comments

Comments
 (0)