6
6
from spack .package import *
7
7
8
8
9
- class Spiner (CMakePackage , CudaPackage ):
9
+ class Spiner (CMakePackage ):
10
10
"""Spiner:
11
11
Performance portable routines for generic, tabulated, multi-dimensional data"""
12
12
@@ -44,7 +44,6 @@ class Spiner(CMakePackage, CudaPackage):
44
44
default = False ,
45
45
description = "Enable kokkos" ,
46
46
)
47
- variant ("openmp" , default = False , description = "Enable openmp kokkos backend" )
48
47
49
48
variant ("hdf5" , default = False , description = "Enable hdf5" )
50
49
variant ("mpi" , default = False , description = "Support parallel hdf5" )
@@ -64,13 +63,9 @@ class Spiner(CMakePackage, CudaPackage):
64
63
# Currently the raw cuda backend of ports-of-call is not supported.
65
64
depends_on ("ports-of-call portability_strategy=Kokkos" , when = "@:1.5.1 +kokkos" )
66
65
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 )
71
66
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 " ,
74
69
)
75
70
76
71
depends_on ("hdf5+hl~mpi" , when = "+hdf5~mpi" )
@@ -81,9 +76,6 @@ class Spiner(CMakePackage, CudaPackage):
81
76
depends_on ("py-matplotlib" , when = "+python" )
82
77
83
78
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" )
87
79
88
80
def cmake_args (self ):
89
81
if self .spec .satisfies ("@1.6.0:" ):
@@ -93,14 +85,16 @@ def cmake_args(self):
93
85
use_kokkos_option = "SPINER_USE_KOKKOS"
94
86
use_cuda_option = "SPINER_USE_CUDA"
95
87
88
+ use_cuda = self .spec .satisfies ("^kokkos+cuda" )
89
+
96
90
args = [
97
91
self .define ("BUILD_TESTING" , self .run_tests ),
98
92
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 ),
100
94
self .define_from_variant ("SPINER_USE_HDF" , "hdf5" ),
101
95
]
102
- if "+cuda" in self . spec :
96
+ if use_cuda :
103
97
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 )
105
99
)
106
100
return args
0 commit comments