[PATCH] D114326: Update the list of CUDA versions up to 11.5
Mojca Miklavec via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 25 09:05:58 PST 2021
mojca added a comment.
Somewhat off-topic from a discussion earlier in the thread.
What's the purpose of the following code then if users are supposed to explicitly specify the `-L` flag anyway?
c++
if (HostTriple.isArch64Bit() && FS.exists(InstallPath + "/lib64"))
LibPath = InstallPath + "/lib64";
else if (FS.exists(InstallPath + "/lib"))
LibPath = InstallPath + "/lib";
else
continue;
The code above may be improved for Windows (it needs a different path there), for example like this:
c++
if (HostTriple.isOSWindows() && (HostTriple.getArch() == llvm::Triple::ArchType::x86_64) && FS.exists(InstallPath + "/lib/x64"))
LibPath = InstallPath + "/lib/x64";
if (HostTriple.isArch64Bit() && FS.exists(InstallPath + "/lib64"))
LibPath = InstallPath + "/lib64";
else if (FS.exists(InstallPath + "/lib"))
LibPath = InstallPath + "/lib";
else
continue;
but I fail to figure out how to make use of this variable.
CMake might be able to add the right flags automatically (but it doesn't currently support Clang with CUDA on Windows), but writing the following down "manually" is relatively annoying:
clang++.exe hello.cu -o hello --cuda-path="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.4" -l cudart -L "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.4/lib/x64"
Also, it's probably destined to lead into issues if the user needs to manually specify the library path, while the cuda path is determined automatically.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D114326/new/
https://reviews.llvm.org/D114326
More information about the cfe-commits
mailing list