This is an archive of the discontinued LLVM Phabricator instance.

[HIP] Supports env var HIP_PATH
ClosedPublic

Authored by yaxunl on Mar 6 2023, 8:22 AM.

Details

Summary

Currently HIP toolchain recognize env var ROCM_PATH and option --rocm-path
but only recognize --hip-path.

Some package management tools e.g. Spack relies on env var HIP_PATH to
be able to load different version of HIP dynamically.
(https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/hip/package.py#L446)
Therefore add support of env var HIP_PATH.

Diff Detail

Event Timeline

yaxunl created this revision.Mar 6 2023, 8:22 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 6 2023, 8:22 AM
yaxunl requested review of this revision.Mar 6 2023, 8:22 AM
yaxunl edited the summary of this revision. (Show Details)Mar 6 2023, 8:24 AM
tra added inline comments.Mar 6 2023, 11:59 AM
clang/lib/Driver/ToolChains/AMDGPU.cpp
442

Style nit. Single-statement if body should be w/o {}.

tra accepted this revision.Mar 6 2023, 11:59 AM
This revision is now accepted and ready to land.Mar 6 2023, 11:59 AM
MaskRay added inline comments.Mar 6 2023, 1:24 PM
clang/test/Driver/rocm-detect.hip
42

%T is not recommended.

https://llvm.org/docs/CommandGuide/lit.html
"parent directory of %t (not unique, deprecated, do not use)"

Just use RUN: rm -rf %t && mkdir %t

MaskRay requested changes to this revision.Mar 6 2023, 1:24 PM
This revision now requires changes to proceed.Mar 6 2023, 1:24 PM
yaxunl marked 2 inline comments as done.Mar 14 2023, 7:19 AM
yaxunl added inline comments.
clang/lib/Driver/ToolChains/AMDGPU.cpp
442

will fix

clang/test/Driver/rocm-detect.hip
42

I will use %t/myhip, as I need a deterministic unique name to check that it is used

yaxunl updated this revision to Diff 505133.Mar 14 2023, 9:04 AM
yaxunl marked 2 inline comments as done.

fix tests

MaskRay accepted this revision.Mar 23 2023, 7:04 PM
This revision is now accepted and ready to land.Mar 23 2023, 7:04 PM
This revision was landed with ongoing or failed builds.Apr 2 2023, 6:40 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptApr 2 2023, 6:40 AM