Skip to content

Commit

Permalink
[HIP] Detect HIP for Ubuntu, Mint, Gentoo, etc.
Browse files Browse the repository at this point in the history
HIP may be installed into /usr or /usr/local on a variety of Linux
operating systems. It may become unwieldy to list them all.

Reviewed by: Siu Chi Chan, Yaxun Liu

Differential Revision: https://reviews.llvm.org/D149110
  • Loading branch information
cgmb authored and yxsamliu committed May 9, 2023
1 parent 60a4cb7 commit f859835
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions clang/lib/Driver/ToolChains/AMDGPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include "clang/Basic/TargetID.h"
#include "clang/Config/config.h"
#include "clang/Driver/Compilation.h"
#include "clang/Driver/Distro.h"
#include "clang/Driver/DriverDiagnostic.h"
#include "clang/Driver/InputInfo.h"
#include "clang/Driver/Options.h"
Expand Down Expand Up @@ -309,13 +308,10 @@ RocmInstallationDetector::getInstallationPathCandidates() {
ROCmSearchDirs.emplace_back(D.SysRoot + "/opt/" + LatestROCm,
/*StrictChecking=*/true);

Distro Dist(D.getVFS(), llvm::Triple(llvm::sys::getProcessTriple()));
if (Dist.IsDebian() || Dist.IsRedhat()) {
ROCmSearchDirs.emplace_back(D.SysRoot + "/usr/local",
/*StrictChecking=*/true);
ROCmSearchDirs.emplace_back(D.SysRoot + "/usr",
/*StrictChecking=*/true);
}
ROCmSearchDirs.emplace_back(D.SysRoot + "/usr/local",
/*StrictChecking=*/true);
ROCmSearchDirs.emplace_back(D.SysRoot + "/usr",
/*StrictChecking=*/true);

DoPrintROCmSearchDirs();
return ROCmSearchDirs;
Expand Down

0 comments on commit f859835

Please sign in to comment.