[PATCH] D108247: [CUDA] Improve CUDA version detection and diagnostics.

Artem Belevich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 17 14:55:57 PDT 2021


tra created this revision.
tra added reviewers: Hahnfeld, yaxunl.
Herald added subscribers: dexonsmith, bixia.
tra requested review of this revision.
Herald added a project: clang.

Always use cuda.h to detect CUDA version. It's a more universal approach
compared to version.txt which is no longer present in recent CUDA versions.

Split the 'unknown CUDA version' warning in two:

- when detected CUDA version is partially supported by clang. It's expected to

work in general, at the feature parity with the latest supported CUDA
version. and may be missing support for the new features/instructions/GPU
variants. Clang will issue a warning.

- when detected version is new. Recent CUDA versions have been working with

clang reasonably well, and will likely to work similarly to the partially
supported ones above. Or it may not work at all. Clang will issue a warning and
proceed as if the latest known CUDA version was detected.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D108247

Files:
  clang/include/clang/Basic/Cuda.h
  clang/include/clang/Basic/DiagnosticDriverKinds.td
  clang/lib/Basic/Cuda.cpp
  clang/lib/Driver/ToolChains/Cuda.cpp
  clang/lib/Driver/ToolChains/Cuda.h
  clang/test/Driver/Inputs/CUDA-new/usr/local/cuda/bin/.keep
  clang/test/Driver/Inputs/CUDA-new/usr/local/cuda/include/.keep
  clang/test/Driver/Inputs/CUDA-new/usr/local/cuda/include/cuda.h
  clang/test/Driver/Inputs/CUDA-new/usr/local/cuda/lib/.keep
  clang/test/Driver/Inputs/CUDA-new/usr/local/cuda/lib64/.keep
  clang/test/Driver/Inputs/CUDA-new/usr/local/cuda/nvvm/libdevice/libdevice.10.bc
  clang/test/Driver/Inputs/CUDA-unknown/usr/local/cuda/version.txt
  clang/test/Driver/Inputs/CUDA_80/usr/local/cuda/include/cuda.h
  clang/test/Driver/Inputs/CUDA_80/usr/local/cuda/version.txt
  clang/test/Driver/Inputs/CUDA_90/usr/local/cuda/include/cuda.h
  clang/test/Driver/cuda-version-check.cu

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108247.367025.patch
Type: text/x-patch
Size: 12473 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210817/e09f9735/attachment-0001.bin>


More information about the cfe-commits mailing list