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
This commit is contained in:
Cory Bloor 2022-09-04 20:18:33 -06:00 committed by GitHub
parent c25b7ea898
commit b093929f91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,6 +77,11 @@ class Rocthrust(CMakePackage):
deprecated=True, 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( variant(
"build_type", "build_type",
default="Release", 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.10.2:", type="build", when="@4.2.0:")
depends_on("cmake@3.5.1:", type="build") 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 [ for ver in [
"3.5.0", "3.5.0",
@ -114,7 +120,13 @@ def setup_build_environment(self, env):
env.set("CXX", self.spec["hip"].hipcc) env.set("CXX", self.spec["hip"].hipcc)
def cmake_args(self): 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"): if self.spec.satisfies("^cmake@3.21.0:3.21.2"):
args.append(self.define("__skip_rocmclang", "ON")) args.append(self.define("__skip_rocmclang", "ON"))