gaijiading updated this revision to Diff 166206. gaijiading added a comment.
Apologies for having uploaded the wrong patch in my original review request. Please help review this version instead. Thanks. Repository: rC Clang https://reviews.llvm.org/D52259 Files: lib/Driver/ToolChains/Cuda.cpp Index: lib/Driver/ToolChains/Cuda.cpp =================================================================== --- lib/Driver/ToolChains/Cuda.cpp +++ lib/Driver/ToolChains/Cuda.cpp @@ -87,6 +87,10 @@ D.SysRoot + "/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v" + Ver); } else { + Candidates.emplace_back(D.SysRoot + "/usr/local/cuda"); + for (const char *Ver : Versions) + Candidates.emplace_back(D.SysRoot + "/usr/local/cuda-" + Ver); + if (!Args.hasArg(clang::driver::options::OPT_cuda_path_ignore_env)) { // Try to find ptxas binary. If the executable is located in a directory // called 'bin/', its parent directory might be a good guess for a valid @@ -108,10 +112,6 @@ } } - Candidates.emplace_back(D.SysRoot + "/usr/local/cuda"); - for (const char *Ver : Versions) - Candidates.emplace_back(D.SysRoot + "/usr/local/cuda-" + Ver); - if (Distro(D.getVFS()).IsDebian()) // Special case for Debian to have nvidia-cuda-toolkit work // out of the box. More info on http://bugs.debian.org/882505
Index: lib/Driver/ToolChains/Cuda.cpp =================================================================== --- lib/Driver/ToolChains/Cuda.cpp +++ lib/Driver/ToolChains/Cuda.cpp @@ -87,6 +87,10 @@ D.SysRoot + "/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v" + Ver); } else { + Candidates.emplace_back(D.SysRoot + "/usr/local/cuda"); + for (const char *Ver : Versions) + Candidates.emplace_back(D.SysRoot + "/usr/local/cuda-" + Ver); + if (!Args.hasArg(clang::driver::options::OPT_cuda_path_ignore_env)) { // Try to find ptxas binary. If the executable is located in a directory // called 'bin/', its parent directory might be a good guess for a valid @@ -108,10 +112,6 @@ } } - Candidates.emplace_back(D.SysRoot + "/usr/local/cuda"); - for (const char *Ver : Versions) - Candidates.emplace_back(D.SysRoot + "/usr/local/cuda-" + Ver); - if (Distro(D.getVFS()).IsDebian()) // Special case for Debian to have nvidia-cuda-toolkit work // out of the box. More info on http://bugs.debian.org/882505
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits