]> granicus.if.org Git - clang/commit
[CUDA] Added partial support for CUDA-9.1
authorArtem Belevich <tra@google.com>
Tue, 30 Jan 2018 00:00:12 +0000 (00:00 +0000)
committerArtem Belevich <tra@google.com>
Tue, 30 Jan 2018 00:00:12 +0000 (00:00 +0000)
commitccacb5ddbcbb10d9b3a4b7e2780875d1e5537063
treee375b9a57bb3594724e563d4e5a028d3d30454a1
parent82aa86f5d3a79abcdd363475d1509c564c178126
[CUDA] Added partial support for CUDA-9.1

Clang can use CUDA-9.1 now, though new APIs (are not implemented yet.

The major change is that headers in CUDA-9.1 went through substantial
changes that started in CUDA-9.0 which required substantial changes
in the cuda compatibility headers provided by clang.

There are two major issues:
* CUDA SDK no longer provides declarations for libdevice functions.
* A lot of device-side functions have become nvcc's builtins and
  CUDA headers no longer contain their implementations.

This patch changes the way CUDA headers are handled if we compile
with CUDA 9.x. Both 9.0 and 9.1 are affected.

* Clang provides its own declarations of libdevice functions.
* For CUDA-9.x clang now provides implementation of device-side
  'standard library' functions using libdevice.

This patch should not affect compilation with CUDA-8. There may be
some observable differences for CUDA-9.0, though they are not expected
to affect functionality.

Tested: CUDA test-suite tests for all supported combinations of:
        CUDA: 7.0,7.5,8.0,9.0,9.1
        GPU: sm_20, sm_35, sm_60, sm_70

Differential Revision: https://reviews.llvm.org/D42513

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@323713 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/Cuda.h
lib/Basic/Cuda.cpp
lib/Basic/Targets/NVPTX.cpp
lib/Driver/ToolChains/Cuda.cpp
lib/Headers/CMakeLists.txt
lib/Headers/__clang_cuda_device_functions.h [new file with mode: 0644]
lib/Headers/__clang_cuda_libdevice_declares.h [new file with mode: 0644]
lib/Headers/__clang_cuda_runtime_wrapper.h