File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -136,6 +136,11 @@ CudaInstallationDetector::CudaInstallationDetector(
136
136
Candidates.emplace_back (
137
137
Args.getLastArgValue (clang::driver::options::OPT_cuda_path_EQ).str ());
138
138
} 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
+
139
144
for (const char *Ver : Versions)
140
145
Candidates.emplace_back (
141
146
D.SysRoot + " /Program Files/NVIDIA GPU Computing Toolkit/CUDA/v" +
Original file line number Diff line number Diff line change
1
+ // /
2
+ // / Make sure that CUDA_PATH is picked up correctly when looking for CUDA
3
+ // / installation.
4
+ // /
5
+
6
+ // REQUIRES: system-windows
7
+ // RUN: env CUDA_PATH=%S\Inputs\CUDA_111\usr\local\cuda %clang -fsycl \
8
+ // RUN: -fsycl-targets=nvptx64-nvidia-cuda -### -v %s 2>&1 | \
9
+ // RUN: FileCheck %s
10
+
11
+ // CHECK: Found CUDA installation: {{.*}}Inputs\CUDA_111\usr\local\cuda, version 11.1
You can’t perform that action at this time.
0 commit comments