summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/Cuda.cpp
diff options
context:
space:
mode:
authorJustin Lebar <jlebar@google.com>2017-10-25 21:32:06 +0000
committerJustin Lebar <jlebar@google.com>2017-10-25 21:32:06 +0000
commit066494d8c1a10890e8b281edcc12c5c122208ba6 (patch)
tree77b8fef35aedf8596eb9a4c7906371d218f76114 /clang/lib/Basic/Cuda.cpp
parent5ff01cdc59027ed3d298dd650786ab4d30b21d81 (diff)
downloadbcm5719-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.cpp12
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
OpenPOWER on IntegriCloud