diff options
author | Justin Lebar <jlebar@google.com> | 2016-07-07 18:17:52 +0000 |
---|---|---|
committer | Justin Lebar <jlebar@google.com> | 2016-07-07 18:17:52 +0000 |
commit | c43ad9ee5ac96f3e66cbfd063aa918db4d68b560 (patch) | |
tree | 1ed9c59ab95a3f8af604a292c6d2ec3d1bc8d62b /clang/lib/Driver/Tools.cpp | |
parent | 495f1a22af257cbfd484eaadded75de259b307bd (diff) | |
download | llvm-c43ad9ee5ac96f3e66cbfd063aa918db4d68b560.zip llvm-c43ad9ee5ac96f3e66cbfd063aa918db4d68b560.tar.gz llvm-c43ad9ee5ac96f3e66cbfd063aa918db4d68b560.tar.bz2 |
[CUDA] Check that our CUDA install supports the requested architectures.
Summary:
Raise an error if you're using a CUDA installation that's too old for
the requested architectures. In practice, this means that you need a
CUDA 8 install to compile for sm_6*.
Reviewers: tra
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D21869
llvm-svn: 274781
Diffstat (limited to 'clang/lib/Driver/Tools.cpp')
-rw-r--r-- | clang/lib/Driver/Tools.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 14ed0d4..50a3588 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -11146,6 +11146,12 @@ void NVPTX::Assembler::ConstructJob(Compilation &C, const JobAction &JA, assert(gpu_archs.size() == 1 && "Exactly one GPU Arch required for ptxas."); const std::string& gpu_arch = gpu_archs[0]; + // Check that our installation's ptxas supports gpu_arch. + if (!Args.hasArg(options::OPT_nocuda_version_check)) { + TC.cudaInstallation().CheckCudaVersionSupportsArch( + StringToCudaArch(gpu_arch)); + } + ArgStringList CmdArgs; CmdArgs.push_back(TC.getTriple().isArch64Bit() ? "-m64" : "-m32"); if (Args.hasFlag(options::OPT_cuda_noopt_device_debug, |