diff options
author | Justin Lebar <jlebar@google.com> | 2017-10-25 21:32:06 +0000 |
---|---|---|
committer | Justin Lebar <jlebar@google.com> | 2017-10-25 21:32:06 +0000 |
commit | 066494d8c1a10890e8b281edcc12c5c122208ba6 (patch) | |
tree | 77b8fef35aedf8596eb9a4c7906371d218f76114 /clang/lib/Basic/Cuda.cpp | |
parent | 5ff01cdc59027ed3d298dd650786ab4d30b21d81 (diff) | |
download | bcm5719-llvm-066494d8c1a10890e8b281edcc12c5c122208ba6.tar.gz bcm5719-llvm-066494d8c1a10890e8b281edcc12c5c122208ba6.zip |
[CUDA] Print an error if you try to compile with < sm_30 on CUDA 9.
Summary:
CUDA 9's minimum sm is sm_30.
Ideally we should also make sm_30 the default when compiling with CUDA
9, but that seems harder than it should be.
Subscribers: sanjoy
Differential Revision: https://reviews.llvm.org/D39109
llvm-svn: 316611
Diffstat (limited to 'clang/lib/Basic/Cuda.cpp')
-rw-r--r-- | clang/lib/Basic/Cuda.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/Basic/Cuda.cpp b/clang/lib/Basic/Cuda.cpp index 3a5297b0c64..58b99a3b58c 100644 --- a/clang/lib/Basic/Cuda.cpp +++ b/clang/lib/Basic/Cuda.cpp @@ -180,4 +180,16 @@ CudaVersion MinVersionForCudaArch(CudaArch A) { llvm_unreachable("invalid enum"); } +CudaVersion MaxVersionForCudaArch(CudaArch A) { + switch (A) { + case CudaArch::UNKNOWN: + return CudaVersion::UNKNOWN; + case CudaArch::SM_20: + case CudaArch::SM_21: + return CudaVersion::CUDA_80; + default: + return CudaVersion::LATEST; + } +} + } // namespace clang |