[PATCH] D98867: [HIP] Fix ROCm detection

2021-03-22 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG282bf9eaf7b1: [HIP] Fix ROCm detection (authored by yaxunl). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98867/new/ https://

[PATCH] D98867: [HIP] Fix ROCm detection

2021-03-22 Thread Artem Belevich via Phabricator via cfe-commits
tra accepted this revision. tra added inline comments. This revision is now accepted and ready to land. Comment at: clang/lib/Driver/ToolChains/AMDGPU.cpp:269 +if (Loc != StringRef::npos) + VerStr[Loc] = '.'; +V.tryParse(VerStr); yaxunl wrote: > tra

[PATCH] D98867: [HIP] Fix ROCm detection

2021-03-20 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 332104. yaxunl marked 2 inline comments as done. yaxunl added a comment. revised by Artem's comments CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98867/new/ https://reviews.llvm.org/D98867 Files: clang/lib/Driver/ToolChains/AMDGPU.cpp clang/tes

[PATCH] D98867: [HIP] Fix ROCm detection

2021-03-20 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 2 inline comments as done. yaxunl added inline comments. Comment at: clang/lib/Driver/ToolChains/AMDGPU.cpp:267-268 +// rocm-{major}.{minor}.{subMinor}[-{build}] +auto Loc = StringRef(VerStr).rfind('_'); +if (Loc != StringRef::npos) + VerStr[Loc] =

[PATCH] D98867: [HIP] Fix ROCm detection

2021-03-19 Thread Artem Belevich via Phabricator via cfe-commits
tra added inline comments. Comment at: clang/lib/Driver/ToolChains/AMDGPU.cpp:267-268 +// rocm-{major}.{minor}.{subMinor}[-{build}] +auto Loc = StringRef(VerStr).rfind('_'); +if (Loc != StringRef::npos) + VerStr[Loc] = '.'; You don't need `String

[PATCH] D98867: [HIP] Fix ROCm detection

2021-03-19 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 331889. yaxunl marked an inline comment as done. yaxunl added a comment. fix version comparison CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98867/new/ https://reviews.llvm.org/D98867 Files: clang/lib/Driver/ToolChains/AMDGPU.cpp clang/test/Dri

[PATCH] D98867: [HIP] Fix ROCm detection

2021-03-19 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: clang/lib/Driver/ToolChains/AMDGPU.cpp:271 +} +if (LatestROCm < FileName) + LatestROCm = FileName.str(); tra wrote: > This will rank `rocm-3.9` higher than `rocm-3.10`

[PATCH] D98867: [HIP] Fix ROCm detection

2021-03-18 Thread Artem Belevich via Phabricator via cfe-commits
tra added inline comments. Comment at: clang/lib/Driver/ToolChains/AMDGPU.cpp:271 +} +if (LatestROCm < FileName) + LatestROCm = FileName.str(); This will rank `rocm-3.9` higher than `rocm-3.10`. I think you do need to extract and compare the version

[PATCH] D98867: [HIP] Fix ROCm detection

2021-03-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. Herald added subscribers: kerbowa, nhaehnle, jvesely. yaxunl requested review of this revision. ROCm has changed installation path to /opt/rocm-{release}. Add detection for that. Also support ROCM_PATH environment variable. https://revi