@@ -180,6 +180,8 @@ bool RocmInstallationDetector::parseHIPVersionFile(llvm::StringRef V) {
180180const SmallVectorImpl<RocmInstallationDetector::Candidate> &
181181RocmInstallationDetector::getInstallationPathCandidates () {
182182
183+ /* salinas */ fprintf (stderr," DAVE: RocmInstallationDetector::getInstallationPathCandidates() ...\n " );
184+
183185 // Return the cached candidate list if it has already been populated.
184186 if (!ROCmSearchDirs.empty ())
185187 return ROCmSearchDirs;
@@ -306,7 +308,12 @@ RocmInstallationDetector::getInstallationPathCandidates() {
306308 LatestVer = Ver;
307309 }
308310 }
309- if (!isHostWindows ()) {
311+
312+ fprintf (stderr," DAVE: checking isHostWindows() ...\n " ); /* salinas */
313+
314+ if (!isHostWindows ()) { /* salinas */
315+ fprintf (stderr, " \t NOT WINDOWS ....\n " );
316+
310317 if (!LatestROCm.empty ())
311318 ROCmSearchDirs.emplace_back (D.SysRoot + " /opt/" + LatestROCm,
312319 /* StrictChecking=*/ true );
@@ -315,16 +322,19 @@ RocmInstallationDetector::getInstallationPathCandidates() {
315322 /* StrictChecking=*/ true );
316323 ROCmSearchDirs.emplace_back (D.SysRoot + " /usr" ,
317324 /* StrictChecking=*/ true );
318- }
325+ } /* salinas */ else fprintf (stderr, " \t IS WINDOWS! \n " );
319326
320327 DoPrintROCmSearchDirs ();
321328 return ROCmSearchDirs;
322329}
323330
324331RocmInstallationDetector::RocmInstallationDetector (
325332 const Driver &D, const llvm::Triple &TargetTriple,
326- const llvm::opt::ArgList &Args, bool DetectHIPRuntime, bool DetectDeviceLib)
333+ const llvm::opt::ArgList &Args /* , SALINAS bool DetectHIPRuntime,
334+ bool DetectDeviceLib, bool isMSVC*/ )
327335 : D(D), TargetTriple(TargetTriple) {
336+ /* salinas */ fprintf (stderr," RocmInstallationDetector::RocmInstallationDetector() ... \n " );
337+ /* SALINAS IsHostMSVC = isMSVC; */
328338 Verbose = Args.hasArg (options::OPT_v);
329339 RocmPathArg = Args.getLastArgValue (clang::driver::options::OPT_rocm_path_EQ);
330340 PrintROCmSearchDirs =
@@ -378,10 +388,13 @@ RocmInstallationDetector::RocmInstallationDetector(
378388 .str ();
379389 }
380390
381- if (DetectHIPRuntime)
382- detectHIPRuntime ();
383- if (DetectDeviceLib)
384- detectDeviceLibrary ();
391+ // if (DetectHIPRuntime) /* salinas */ {
392+ // fprintf(stderr, "DAVE: RocmInstallationDetector ctor: calling "
393+ // "detectHIPRuntime() ...\n");
394+ // detectHIPRuntime();
395+ // }
396+ // if (DetectDeviceLib)
397+ // detectDeviceLibrary();
385398}
386399
387400void RocmInstallationDetector::detectDeviceLibrary () {
@@ -437,6 +450,7 @@ void RocmInstallationDetector::detectDeviceLibrary() {
437450
438451 // Find device libraries in a legacy ROCm directory structure
439452 // ${ROCM_ROOT}/amdgcn/bitcode/*
453+ /* salinas */ fprintf (stderr," DAVE 1: calling getInstallationPathCandidates()\n " );
440454 auto &ROCmDirs = getInstallationPathCandidates ();
441455 for (const auto &Candidate : ROCmDirs) {
442456 LibDevicePath = Candidate.Path ;
@@ -447,7 +461,11 @@ void RocmInstallationDetector::detectDeviceLibrary() {
447461 }
448462}
449463
450- void RocmInstallationDetector::detectHIPRuntime () {
464+ void RocmInstallationDetector::detectHIPRuntime () { /* salinas */
465+ fprintf (stderr, " DAVE: RocmInstallationDetector::detectHIPRuntime()\n " );
466+ /* salinas */ std::optional<std::string> dave =
467+ llvm::sys::Process::GetEnv (" HIP_PATH" );
468+ /* salinas */ if (dave) fprintf (stderr, " DAVE: in detectHIPRuntime(): HIP_PATH = %s\n " ,(*dave).c_str ());
451469 SmallVector<Candidate, 4 > HIPSearchDirs;
452470 if (!HIPPathArg.empty ())
453471 HIPSearchDirs.emplace_back (HIPPathArg.str ());
@@ -456,8 +474,12 @@ void RocmInstallationDetector::detectHIPRuntime() {
456474 if (!HIPPathEnv->empty ())
457475 HIPSearchDirs.emplace_back (std::move (*HIPPathEnv));
458476 }
459- if (HIPSearchDirs.empty ())
477+ if (HIPSearchDirs.empty ()) { /* salinas */
478+ /* salinas */ fprintf (stderr," DAVE 1: calling getInstallationPathCandidates()\n " );
460479 HIPSearchDirs.append (getInstallationPathCandidates ());
480+ } /* salinas */ else
481+ fprintf (stderr,
482+ " DAVE: detectHIPRuntime() .... HIPSearchDirs is NOT empty!\n " );
461483 auto &FS = D.getVFS ();
462484
463485 for (const auto &Candidate : HIPSearchDirs) {
@@ -688,13 +710,16 @@ void amdgpu::getAMDGPUTargetFeatures(const Driver &D,
688710AMDGPUToolChain::AMDGPUToolChain (const Driver &D, const llvm::Triple &Triple,
689711 const ArgList &Args)
690712 : Generic_ELF(D, Triple, Args),
691- OptionsDefault(
692- {{options::OPT_O, " 3" }, {options::OPT_cl_std_EQ, " CL1.2" }}) {
713+ OptionsDefault({{options::OPT_O, " 3" },
714+ {options::OPT_cl_std_EQ, " CL1.2" }}) { /* salinas */
715+ fprintf (stderr, " ========= DAVE =========== AMDGPUToolChain() ctor ....\n " );
693716 // Check code object version options. Emit warnings for legacy options
694717 // and errors for the last invalid code object version options.
695718 // It is done here to avoid repeated warning or error messages for
696719 // each tool invocation.
697720 checkAMDGPUCodeObjectVersion (D, Args);
721+ /* salinas */ fprintf (
722+ stderr, " ===== DVE: AMDGPUToolChain ctor END ..... =========\n " );
698723}
699724
700725Tool *AMDGPUToolChain::buildLinker () const {
@@ -823,10 +848,13 @@ bool AMDGPUToolChain::isWave64(const llvm::opt::ArgList &DriverArgs,
823848// / ROCM Toolchain
824849ROCMToolChain::ROCMToolChain (const Driver &D, const llvm::Triple &Triple,
825850 const ArgList &Args, bool isHostTCMSVC)
826- : AMDGPUToolChain(D, Triple, Args) {
851+ : AMDGPUToolChain(D, Triple, Args) { /* salinas */ fprintf (stderr," DAVE: ROCMToolChain::ROCMToolChain() ...\n " );
852+ /* salinas */ fprintf (
853+ stderr, " DAVE: in ROCMToolChain ctor calling setHostWindows()\n " );
827854 RocmInstallation->setHostWindows (isHostTCMSVC);
828855
829856 RocmInstallation->detectDeviceLibrary ();
857+ /* salinas */ fprintf (stderr, " DAVE: end of ROCMToolChain ctor\n " );
830858}
831859
832860void AMDGPUToolChain::addClangTargetOptions (
0 commit comments