Skip to content

Commit

Permalink
spack: remove openmp and cuda variants
Browse files Browse the repository at this point in the history
Inherits however kokkos was configured.
  • Loading branch information
rbberger committed Feb 23, 2024
1 parent 87a4869 commit be1f8b4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ before_script:
- |
if [[ ${CI_JOB_NAME} =~ "a100" ]];
then
export SPINER_SPACK_SPEC="${SPINER_SPACK_SPEC}+hdf5+mpi+kokkos+cuda cuda_arch=80";
export SPINER_SPACK_SPEC="${SPINER_SPACK_SPEC}+hdf5+mpi+kokkos ^kokkos+wrapper+cuda cuda_arch=80";
fi
- |
if [[ "${CI_COMMIT_BRANCH}" == "${CI_DEFAULT_BRANCH}" ]];
Expand Down
22 changes: 8 additions & 14 deletions spack-repo/packages/spiner/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from spack.package import *


class Spiner(CMakePackage, CudaPackage):
class Spiner(CMakePackage):
"""Spiner:
Performance portable routines for generic, tabulated, multi-dimensional data"""

Expand Down Expand Up @@ -44,7 +44,6 @@ class Spiner(CMakePackage, CudaPackage):
default=False,
description="Enable kokkos",
)
variant("openmp", default=False, description="Enable openmp kokkos backend")

variant("hdf5", default=False, description="Enable hdf5")
variant("mpi", default=False, description="Support parallel hdf5")
Expand All @@ -64,13 +63,9 @@ class Spiner(CMakePackage, CudaPackage):
# Currently the raw cuda backend of ports-of-call is not supported.
depends_on("ports-of-call portability_strategy=Kokkos", when="@:1.5.1 +kokkos")
depends_on("ports-of-call portability_strategy=None", when="@:1.5.1 ~kokkos")
for _flag in list(CudaPackage.cuda_arch_values):
depends_on("[email protected]: cuda_arch=" + _flag, when="+cuda+kokkos cuda_arch=" + _flag)
for _flag in ("~cuda", "+cuda", "~openmp", "+openmp"):
depends_on("[email protected]: " + _flag, when="+kokkos" + _flag)
depends_on(
"[email protected]: ~shared+wrapper+cuda_lambda+cuda_constexpr",
when="+cuda+kokkos",
"[email protected]: ~shared+cuda_lambda+cuda_constexpr",
when="+kokkos ^kokkos+cuda",
)

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

conflicts("+mpi", when="~hdf5")
conflicts("+cuda", when="~kokkos")
conflicts("+openmp", when="~kokkos")
conflicts("cuda_arch=none", when="+cuda", msg="CUDA architecture is required")

def cmake_args(self):
if self.spec.satisfies("@1.6.0:"):
Expand All @@ -93,14 +85,16 @@ def cmake_args(self):
use_kokkos_option = "SPINER_USE_KOKKOS"
use_cuda_option = "SPINER_USE_CUDA"

use_cuda = self.spec.satisfies("^kokkos+cuda")

args = [
self.define("BUILD_TESTING", self.run_tests),
self.define_from_variant(use_kokkos_option, "kokkos"),
self.define_from_variant(use_cuda_option, "cuda"),
self.define(use_cuda_option, use_cuda),
self.define_from_variant("SPINER_USE_HDF", "hdf5"),
]
if "+cuda" in self.spec:
if use_cuda:
args.append(
self.define("CMAKE_CUDA_ARCHITECTURES", self.spec.variants["cuda_arch"].value)
self.define("CMAKE_CUDA_ARCHITECTURES", self.spec["kokkos"].variants["cuda_arch"].value)
)
return args

0 comments on commit be1f8b4

Please sign in to comment.