@@ -546,26 +546,35 @@ void RocmInstallationDetector::AddHIPIncludeArgs(const ArgList &DriverArgs,
546
546
}
547
547
548
548
const auto HandleHipStdPar = [=, &DriverArgs, &CC1Args]() {
549
- if (!hasHIPStdParLibrary ()) {
549
+ StringRef Inc = getIncludePath ();
550
+ auto &FS = D.getVFS ();
551
+
552
+ if (!hasHIPStdParLibrary ())
553
+ if (!HIPStdParPathArg.empty () ||
554
+ !FS.exists (Inc + " /thrust/system/hip/hipstdpar/hipstdpar_lib.hpp" )) {
550
555
D.Diag (diag::err_drv_no_hipstdpar_lib);
551
556
return ;
552
557
}
553
- if (!HasRocThrustLibrary &&
554
- !D.getVFS ().exists (getIncludePath () + " /thrust" )) {
558
+ if (!HasRocThrustLibrary && !FS.exists (Inc + " /thrust" )) {
555
559
D.Diag (diag::err_drv_no_hipstdpar_thrust_lib);
556
560
return ;
557
561
}
558
- if (!HasRocPrimLibrary &&
559
- !D.getVFS ().exists (getIncludePath () + " /rocprim" )) {
562
+ if (!HasRocPrimLibrary && !FS.exists (Inc + " /rocprim" )) {
560
563
D.Diag (diag::err_drv_no_hipstdpar_prim_lib);
561
564
return ;
562
565
}
563
-
564
566
const char *ThrustPath;
565
567
if (HasRocThrustLibrary)
566
568
ThrustPath = DriverArgs.MakeArgString (HIPRocThrustPathArg);
567
569
else
568
- ThrustPath = DriverArgs.MakeArgString (getIncludePath () + " /thrust" );
570
+ ThrustPath = DriverArgs.MakeArgString (Inc + " /thrust" );
571
+
572
+ const char *HIPStdParPath;
573
+ if (hasHIPStdParLibrary ())
574
+ HIPStdParPath = DriverArgs.MakeArgString (HIPStdParPathArg);
575
+ else
576
+ HIPStdParPath = DriverArgs.MakeArgString (StringRef (ThrustPath) +
577
+ " /system/hip/hipstdpar" );
569
578
570
579
const char *PrimPath;
571
580
if (HasRocPrimLibrary)
@@ -574,7 +583,7 @@ void RocmInstallationDetector::AddHIPIncludeArgs(const ArgList &DriverArgs,
574
583
PrimPath = DriverArgs.MakeArgString (getIncludePath () + " /rocprim" );
575
584
576
585
CC1Args.append ({" -idirafter" , ThrustPath, " -idirafter" , PrimPath,
577
- " -idirafter" , DriverArgs. MakeArgString (HIPStdParPathArg) ,
586
+ " -idirafter" , HIPStdParPath ,
578
587
" -include" , " hipstdpar_lib.hpp" });
579
588
};
580
589
0 commit comments