[PATCH] D42513: [CUDA] Added partial support for CUDA-9.1

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 24 16:13:25 PST 2018


tra created this revision.
tra added reviewers: jlebar, jholewinski.
Herald added subscribers: hintonda, mgorny, sanjoy.

Clang can use CUDA-9.1 now, though new builtins (__hmma_m32n8k16*) 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


https://reviews.llvm.org/D42513

Files:
  clang/include/clang/Basic/Cuda.h
  clang/lib/Basic/Cuda.cpp
  clang/lib/Basic/Targets/NVPTX.cpp
  clang/lib/Driver/ToolChains/Cuda.cpp
  clang/lib/Headers/CMakeLists.txt
  clang/lib/Headers/__clang_cuda_device_functions.h
  clang/lib/Headers/__clang_cuda_libdevice_declares.h
  clang/lib/Headers/__clang_cuda_runtime_wrapper.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42513.131372.patch
Type: text/x-patch
Size: 91149 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180125/f74a73cd/attachment-0001.bin>


More information about the cfe-commits mailing list