Skip to content

Commit 2f69e97

Browse files
committed
[SYCL] Use CUDA_PATH as a candidate for path discovery
1 parent 8734a3d commit 2f69e97

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

clang/lib/Driver/ToolChains/Cuda.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,11 @@ CudaInstallationDetector::CudaInstallationDetector(
136136
Candidates.emplace_back(
137137
Args.getLastArgValue(clang::driver::options::OPT_cuda_path_EQ).str());
138138
} else if (HostTriple.isOSWindows()) {
139+
// CUDA_PATH is set by the installer, prefer it over other versions that
140+
// might be present on the system.
141+
if (const char *CudaPathEnvVar = ::getenv("CUDA_PATH"))
142+
Candidates.emplace_back(CudaPathEnvVar);
143+
139144
for (const char *Ver : Versions)
140145
Candidates.emplace_back(
141146
D.SysRoot + "/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v" +

0 commit comments

Comments
 (0)