[ROCm] change is_hip_clang() to always return True (#147646)

hipify is replacing kernel launchs <<< >>> with hipLaunchKernelGGL() macro and this is a regression caused by /opt/rocm/hip/.hipinfo no longer existing.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/147646
Approved by: https://github.com/jeffdaily, https://github.com/petrex
This commit is contained in:
Ethan Wee
2025-02-22 03:26:51 +00:00
committed by PyTorch MergeBot
parent b11d5cd584
commit fecd3f7ecb

View File

@ -145,13 +145,11 @@ ignores = [os.path.join(proj_dir, ignore) for ignore in ignores]
# Check if the compiler is hip-clang.
#
# This used to be a useful function but now we can safely always assume hip-clang.
# Leaving the function here avoids bc-linter errors.
def is_hip_clang() -> bool:
try:
hip_path = os.getenv("HIP_PATH", "/opt/rocm/hip")
with open(hip_path + "/lib/.hipInfo") as f:
return "HIP_COMPILER=clang" in f.read()
except OSError:
return False
return True
# TODO Remove once the following submodules are updated