@@ -306,15 +306,17 @@ RocmInstallationDetector::getInstallationPathCandidates() {
306306 LatestVer = Ver;
307307 }
308308 }
309- if (!LatestROCm.empty ())
310- ROCmSearchDirs.emplace_back (D.SysRoot + " /opt/" + LatestROCm,
311- /* StrictChecking=*/ true );
312309
313- ROCmSearchDirs. emplace_back (D. SysRoot + " /usr/local " ,
314- /* StrictChecking= */ true );
315- ROCmSearchDirs.emplace_back (D.SysRoot + " /usr " ,
316- /* StrictChecking=*/ true );
310+ if (! isHostWindows ()) {
311+ if (!LatestROCm. empty ())
312+ ROCmSearchDirs.emplace_back (D.SysRoot + " /opt/ " + LatestROCm ,
313+ /* StrictChecking=*/ true );
317314
315+ ROCmSearchDirs.emplace_back (D.SysRoot + " /usr/local" ,
316+ /* StrictChecking=*/ true );
317+ ROCmSearchDirs.emplace_back (D.SysRoot + " /usr" ,
318+ /* StrictChecking=*/ true );
319+ }
318320 DoPrintROCmSearchDirs ();
319321 return ROCmSearchDirs;
320322}
@@ -375,11 +377,6 @@ RocmInstallationDetector::RocmInstallationDetector(
375377 Twine (DefaultVersionMinor) + " ." + VersionPatch)
376378 .str ();
377379 }
378-
379- if (DetectHIPRuntime)
380- detectHIPRuntime ();
381- if (DetectDeviceLib)
382- detectDeviceLibrary ();
383380}
384381
385382void RocmInstallationDetector::detectDeviceLibrary () {
@@ -699,10 +696,12 @@ void amdgpu::getAMDGPUTargetFeatures(const Driver &D,
699696
700697// / AMDGPU Toolchain
701698AMDGPUToolChain::AMDGPUToolChain (const Driver &D, const llvm::Triple &Triple,
702- const ArgList &Args)
699+ const ArgList &Args, bool isHostTCMSVC )
703700 : Generic_ELF(D, Triple, Args),
704701 OptionsDefault(
705702 {{options::OPT_O, " 3" }, {options::OPT_cl_std_EQ, " CL1.2" }}) {
703+ if (!isHostTCMSVC)
704+ RocmInstallation->init ();
706705 // Check code object version options. Emit warnings for legacy options
707706 // and errors for the last invalid code object version options.
708707 // It is done here to avoid repeated warning or error messages for
@@ -835,8 +834,11 @@ bool AMDGPUToolChain::isWave64(const llvm::opt::ArgList &DriverArgs,
835834
836835// / ROCM Toolchain
837836ROCMToolChain::ROCMToolChain (const Driver &D, const llvm::Triple &Triple,
838- const ArgList &Args)
839- : AMDGPUToolChain(D, Triple, Args) {
837+ const ArgList &Args, bool isHostTCMSVC)
838+ : AMDGPUToolChain(D, Triple, Args, isHostTCMSVC) {
839+ RocmInstallation->setHostWindows (isHostTCMSVC);
840+ if (isHostTCMSVC)
841+ RocmInstallation->init (true , false );
840842 RocmInstallation->detectDeviceLibrary ();
841843}
842844
0 commit comments