File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
clang/lib/Driver/ToolChains Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -486,10 +486,15 @@ void RocmInstallationDetector::detectHIPRuntime() {
486
486
return newpath;
487
487
};
488
488
// If HIP version file can be found and parsed, use HIP version from there.
489
- for (const auto &VersionFilePath :
490
- {Append (SharePath, " hip" , " version" ),
491
- Append (ParentSharePath, " hip" , " version" ),
492
- Append (BinPath, " .hipVersion" )}) {
489
+ std::vector<SmallString<0 >> VersionFilePaths = {
490
+ Append (SharePath, " hip" , " version" ),
491
+ InstallPath != " /usr/local" ? Append (ParentSharePath, " hip" , " version" )
492
+ : SmallString<0 >(),
493
+ Append (BinPath, " .hipVersion" )};
494
+
495
+ for (const auto &VersionFilePath : VersionFilePaths) {
496
+ if (VersionFilePath.empty ())
497
+ continue ;
493
498
llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> VersionFile =
494
499
FS.getBufferForFile (VersionFilePath);
495
500
if (!VersionFile)
You can’t perform that action at this time.
0 commit comments