[clang] f859835 - [HIP] Detect HIP for Ubuntu, Mint, Gentoo, etc.

Yaxun Liu via cfe-commits cfe-commits at lists.llvm.org
Tue May 9 08:32:48 PDT 2023


Author: Cordell Bloor
Date: 2023-05-09T11:31:57-04:00
New Revision: f8598357662dc8dd0f4400bcaeb48e8befe43ecc

URL: https://github.com/llvm/llvm-project/commit/f8598357662dc8dd0f4400bcaeb48e8befe43ecc
DIFF: https://github.com/llvm/llvm-project/commit/f8598357662dc8dd0f4400bcaeb48e8befe43ecc.diff

LOG: [HIP] Detect HIP for Ubuntu, Mint, Gentoo, etc.

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

Added: 
    

Modified: 
    clang/lib/Driver/ToolChains/AMDGPU.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/ToolChains/AMDGPU.cpp b/clang/lib/Driver/ToolChains/AMDGPU.cpp
index acedcfabefe1..1eb22ed8704c 100644
--- a/clang/lib/Driver/ToolChains/AMDGPU.cpp
+++ b/clang/lib/Driver/ToolChains/AMDGPU.cpp
@@ -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"
@@ -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;


        


More information about the cfe-commits mailing list