[PATCH] D45827: [CUDA] Enable CUDA compilation with CUDA-9.2
Artem Belevich via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 24 11:28:54 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL330753: [CUDA] Enable CUDA compilation with CUDA-9.2 (authored by tra, committed by ).
Herald added subscribers: llvm-commits, bixia.
Changed prior to commit:
https://reviews.llvm.org/D45827?vs=143124&id=143789#toc
Repository:
rL LLVM
https://reviews.llvm.org/D45827
Files:
cfe/trunk/include/clang/Basic/Cuda.h
cfe/trunk/lib/Basic/Cuda.cpp
cfe/trunk/lib/Driver/ToolChains/Cuda.cpp
cfe/trunk/lib/Headers/__clang_cuda_runtime_wrapper.h
Index: cfe/trunk/lib/Driver/ToolChains/Cuda.cpp
===================================================================
--- cfe/trunk/lib/Driver/ToolChains/Cuda.cpp
+++ cfe/trunk/lib/Driver/ToolChains/Cuda.cpp
@@ -57,6 +57,8 @@
return CudaVersion::CUDA_90;
if (Major == 9 && Minor == 1)
return CudaVersion::CUDA_91;
+ if (Major == 9 && Minor == 2)
+ return CudaVersion::CUDA_92;
return CudaVersion::UNKNOWN;
}
Index: cfe/trunk/lib/Basic/Cuda.cpp
===================================================================
--- cfe/trunk/lib/Basic/Cuda.cpp
+++ cfe/trunk/lib/Basic/Cuda.cpp
@@ -20,6 +20,8 @@
return "9.0";
case CudaVersion::CUDA_91:
return "9.1";
+ case CudaVersion::CUDA_92:
+ return "9.2";
}
llvm_unreachable("invalid enum");
}
Index: cfe/trunk/lib/Headers/__clang_cuda_runtime_wrapper.h
===================================================================
--- cfe/trunk/lib/Headers/__clang_cuda_runtime_wrapper.h
+++ cfe/trunk/lib/Headers/__clang_cuda_runtime_wrapper.h
@@ -62,7 +62,7 @@
#include "cuda.h"
#if !defined(CUDA_VERSION)
#error "cuda.h did not define CUDA_VERSION"
-#elif CUDA_VERSION < 7000 || CUDA_VERSION > 9010
+#elif CUDA_VERSION < 7000 || CUDA_VERSION > 9020
#error "Unsupported CUDA version!"
#endif
@@ -199,6 +199,11 @@
#endif
#if CUDA_VERSION >= 9000
+// CUDA-9.2 needs host-side memcpy for some host functions in
+// device_functions.hpp
+#if CUDA_VERSION >= 9020
+#include <string.h>
+#endif
#include "crt/math_functions.hpp"
#else
#include "math_functions.hpp"
Index: cfe/trunk/include/clang/Basic/Cuda.h
===================================================================
--- cfe/trunk/include/clang/Basic/Cuda.h
+++ cfe/trunk/include/clang/Basic/Cuda.h
@@ -23,7 +23,8 @@
CUDA_80,
CUDA_90,
CUDA_91,
- LATEST = CUDA_91,
+ CUDA_92,
+ LATEST = CUDA_92,
};
const char *CudaVersionToString(CudaVersion V);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45827.143789.patch
Type: text/x-patch
Size: 1907 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180424/bcb486eb/attachment.bin>
More information about the cfe-commits
mailing list