Set CMAKE_HIP_ARCHITECTURES with the value of amdgpu_target (#32901)

This commit is contained in:
Auriane R 2022-10-03 10:22:25 +02:00 committed by GitHub
parent 5a0f4970df
commit 7ee8fd5926
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -142,9 +142,13 @@ def cmake_args(self):
]
# HIP support requires compiling with hipcc for < 0.8.0
if "@:0.7 +rocm" in self.spec:
if self.spec.satisfies("@:0.7 +rocm"):
args += [self.define("CMAKE_CXX_COMPILER", self.spec["hip"].hipcc)]
if self.spec.satisfies("^cmake@3.21.0:3.21.2"):
args += [self.define("__skip_rocmclang", True)]
if self.spec.satisfies("@0.8: +rocm"):
rocm_archs = spec.variants["amdgpu_target"].value
rocm_archs = ";".join(rocm_archs)
args.append(self.define("CMAKE_HIP_ARCHITECTURES", rocm_archs))
return args