[PATCH] D114601: Read path to CUDA from env. variable CUDA_PATH on Windows

Mojca Miklavec via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 25 08:11:10 PST 2021


mojca created this revision.
mojca added reviewers: tra, carlosgalvezp, Hahnfeld.
mojca added a project: clang.
Herald added a subscriber: yaxunl.
mojca requested review of this revision.
Herald added a subscriber: cfe-commits.

This is heavily related to https://reviews.llvm.org/D114326 and uses a different approach for locating path to CUDA on Windows.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D114601

Files:
  clang/lib/Driver/ToolChains/Cuda.cpp


Index: clang/lib/Driver/ToolChains/Cuda.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Cuda.cpp
+++ clang/lib/Driver/ToolChains/Cuda.cpp
@@ -135,10 +135,7 @@
     Candidates.emplace_back(
         Args.getLastArgValue(clang::driver::options::OPT_cuda_path_EQ).str());
   } else if (HostTriple.isOSWindows()) {
-    for (const char *Ver : Versions)
-      Candidates.emplace_back(
-          D.SysRoot + "/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v" +
-          Ver);
+    Candidates.emplace_back(llvm::sys::Process::GetEnv("CUDA_PATH"));
   } else {
     if (!Args.hasArg(clang::driver::options::OPT_cuda_path_ignore_env)) {
       // Try to find ptxas binary. If the executable is located in a directory


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D114601.389803.patch
Type: text/x-patch
Size: 770 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20211125/9baf3e96/attachment-0001.bin>


More information about the cfe-commits mailing list