summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorCory Bloor <Cordell.Bloor@amd.com>2022-09-04 20:18:33 -0600
committerGitHub <noreply@github.com>2022-09-04 19:18:33 -0700
commitb093929f91997cdeae3677a80d5885e362951083 (patch)
treec83e83b9feabfa68a5a7e8a885000d4f734cfb92 /var
parentc25b7ea89867836bd7e8491689c5342af09fc743 (diff)
downloadspack-b093929f91997cdeae3677a80d5885e362951083.tar.gz
spack-b093929f91997cdeae3677a80d5885e362951083.tar.bz2
spack-b093929f91997cdeae3677a80d5885e362951083.tar.xz
spack-b093929f91997cdeae3677a80d5885e362951083.zip
rocthrust: add amdgpu_target and spack build test (#31203)
This change adds support for building the rocthrust tests and adds the `amdgpu_target` variant to the `rocthrust` package. - [x] rocthrust: add amdgpu_target and spack build test - [x] Drop numactl as it is not a direct dependency
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/rocthrust/package.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/rocthrust/package.py b/var/spack/repos/builtin/packages/rocthrust/package.py
index 572ea2ce54..c19903013f 100644
--- a/var/spack/repos/builtin/packages/rocthrust/package.py
+++ b/var/spack/repos/builtin/packages/rocthrust/package.py
@@ -77,6 +77,11 @@ class Rocthrust(CMakePackage):
deprecated=True,
)
+ amdgpu_targets = ROCmPackage.amdgpu_targets
+
+ # the rocthrust library itself is header-only, but the build_type and amdgpu_target
+ # are relevant to the test client
+ variant("amdgpu_target", values=auto_or_any_combination_of(*amdgpu_targets))
variant(
"build_type",
default="Release",
@@ -85,7 +90,8 @@ class Rocthrust(CMakePackage):
)
depends_on("cmake@3.10.2:", type="build", when="@4.2.0:")
depends_on("cmake@3.5.1:", type="build")
- depends_on("numactl", when="@3.7.0:")
+
+ depends_on("googletest@1.10.0:", type="test")
for ver in [
"3.5.0",
@@ -114,7 +120,13 @@ class Rocthrust(CMakePackage):
env.set("CXX", self.spec["hip"].hipcc)
def cmake_args(self):
- args = [self.define("CMAKE_MODULE_PATH", "{0}/cmake".format(self.spec["hip"].prefix))]
+ args = [
+ self.define("CMAKE_MODULE_PATH", "{0}/cmake".format(self.spec["hip"].prefix)),
+ self.define("BUILD_TEST", self.run_tests),
+ ]
+
+ if "auto" not in self.spec.variants["amdgpu_target"]:
+ args.append(self.define_from_variant("AMDGPU_TARGETS", "amdgpu_target"))
if self.spec.satisfies("^cmake@3.21.0:3.21.2"):
args.append(self.define("__skip_rocmclang", "ON"))