hip: get_paths for hipify-clang (#37559)

* hip: get_paths for hipify-clang

* fix: need to actually use get_paths now to get hipify-clang path

* set hipify-clang path differentluy for external vs spack-installed case

* [@spackbot] updating style on behalf of eugeneswalker
This commit is contained in:
eugeneswalker 2023-05-09 08:51:04 -05:00 committed by GitHub
parent 89520467e0
commit 13dd05e5ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -379,6 +379,9 @@ def get_paths(self):
"rocminfo": rocm_prefix, "rocminfo": rocm_prefix,
"rocm-device-libs": rocm_prefix, "rocm-device-libs": rocm_prefix,
} }
if self.spec.satisfies("@5.4:"):
paths["hipify-clang"] = rocm_prefix
else: else:
paths = { paths = {
"hip-path": self.spec.prefix, "hip-path": self.spec.prefix,
@ -389,6 +392,9 @@ def get_paths(self):
"rocm-device-libs": self.spec["llvm-amdgpu"].prefix, "rocm-device-libs": self.spec["llvm-amdgpu"].prefix,
} }
if self.spec.satisfies("@5.4:"):
paths["hipify-clang"] = self.spec["hipify-clang"].prefix
if "@:3.8.0" in self.spec: if "@:3.8.0" in self.spec:
paths["bitcode"] = paths["rocm-device-libs"].lib paths["bitcode"] = paths["rocm-device-libs"].lib
else: else:
@ -417,7 +423,7 @@ def set_variables(self, env):
# there is a common prefix /opt/rocm-x.y.z. # there is a common prefix /opt/rocm-x.y.z.
env.set("ROCM_PATH", paths["rocm-path"]) env.set("ROCM_PATH", paths["rocm-path"])
if self.spec.satisfies("@5.4:"): if self.spec.satisfies("@5.4:"):
env.set("HIPIFY_CLANG_PATH", self.spec["hipify-clang"].prefix) env.set("HIPIFY_CLANG_PATH", paths["hipify-clang"])
# hipcc recognizes HIP_PLATFORM == hcc and HIP_COMPILER == clang, even # hipcc recognizes HIP_PLATFORM == hcc and HIP_COMPILER == clang, even
# though below we specified HIP_PLATFORM=rocclr and HIP_COMPILER=clang # though below we specified HIP_PLATFORM=rocclr and HIP_COMPILER=clang