summaryrefslogtreecommitdiffstats
path: root/clang/lib/Headers/__clang_cuda_runtime_wrapper.h
diff options
context:
space:
mode:
authorArtem Belevich <tra@google.com>2019-01-31 21:34:03 +0000
committerArtem Belevich <tra@google.com>2019-01-31 21:34:03 +0000
commitc62214da3de04f702e29e4ba4772c9463e2829ca (patch)
tree3b37c00552d8dcef2f88e1ec999796dd5798406e /clang/lib/Headers/__clang_cuda_runtime_wrapper.h
parent8fa28a0db058eb53970f7eca3aaf71c86357e478 (diff)
downloadbcm5719-llvm-c62214da3de04f702e29e4ba4772c9463e2829ca.tar.gz
bcm5719-llvm-c62214da3de04f702e29e4ba4772c9463e2829ca.zip
[CUDA] add support for the new kernel launch API in CUDA-9.2+.
Instead of calling CUDA runtime to arrange function arguments, the new API constructs arguments in a local array and the kernels are launched with __cudaLaunchKernel(). The old API has been deprecated and is expected to go away in the next CUDA release. Differential Revision: https://reviews.llvm.org/D57488 llvm-svn: 352799
Diffstat (limited to 'clang/lib/Headers/__clang_cuda_runtime_wrapper.h')
-rw-r--r--clang/lib/Headers/__clang_cuda_runtime_wrapper.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/Headers/__clang_cuda_runtime_wrapper.h b/clang/lib/Headers/__clang_cuda_runtime_wrapper.h
index f05c0454a88..4b3672463e6 100644
--- a/clang/lib/Headers/__clang_cuda_runtime_wrapper.h
+++ b/clang/lib/Headers/__clang_cuda_runtime_wrapper.h
@@ -426,5 +426,15 @@ __device__ inline __cuda_builtin_gridDim_t::operator dim3() const {
#pragma pop_macro("__USE_FAST_MATH__")
#pragma pop_macro("__CUDA_INCLUDE_COMPILER_INTERNAL_HEADERS__")
+// CUDA runtime uses this undocumented function to access kernel launch
+// configuration. The declaration is in crt/device_functions.h but that file
+// includes a lot of other stuff we don't want. Instead, we'll provide our own
+// declaration for it here.
+#if CUDA_VERSION >= 9020
+extern "C" unsigned __cudaPushCallConfiguration(dim3 gridDim, dim3 blockDim,
+ size_t sharedMem = 0,
+ void *stream = 0);
+#endif
+
#endif // __CUDA__
#endif // __CLANG_CUDA_RUNTIME_WRAPPER_H__
OpenPOWER on IntegriCloud