ROCm used to install components under individual directories,
e.g. HIP installed to /opt/rocm/hip and rocblas installed to
/opt/rocm/rocblas. ROCm has transitioned to a flat directory
structure where all components are installed to /opt/rocm.
HIP-PATH and --hip-path are supposed to be /opt/rocm as
clang detect HIP version by /opt/rocm/share/hip/version.
However, some existing HIP app still uses HIP-PATH=/opt/rocm/hip.
To avoid regression, clang will also try detect share/hip/version
under the parent directory of HIP-PATH or --hip-path.
This way, the detection will work for both new HIP-PATH and
old HIP-PATH.
Details
Details
- Reviewers
tra - Commits
- rG41a1625e07e8: [HIP] Fix version detection for old HIP-PATH
Diff Detail
Diff Detail
Event Timeline
Comment Actions
LGTM in general with a minor suggestion.
clang/lib/Driver/ToolChains/AMDGPU.cpp | ||
---|---|---|
471 | We seem to be rather inconsistent about how we handle paths. Above, we use llvm::sys::path::append, but here we revert to just appending a path as a string. I think we should be using llvm::sys::path API consistently. It's unfortunate that the API does not provide a string-returning function to append elements. auto Append = [](SmallVectorImpl<char> &path, const Twine &a, const Twine &b = "", const Twine &c = "", const Twine &d = "") { SmallVectorImpl<char> newpath = path; llvm::sys::path::append(newpath, a,b,c,d); return newpath; } for (const auto &VersionFilePath : {Append(SharePath, "hip", "version"), Append(ParentSharePath, "hip", "version"), Append(BinPath, ".hipVersion")}) { ... } |
clang/lib/Driver/ToolChains/AMDGPU.cpp | ||
---|---|---|
471 | will do. thanks. |
We seem to be rather inconsistent about how we handle paths.
Above, we use llvm::sys::path::append, but here we revert to just appending a path as a string.
I think we should be using llvm::sys::path API consistently. It's unfortunate that the API does not provide a string-returning function to append elements.