[PATCH] D97003: [Clang][OpenMP] Require CUDA 9+ for OpenMP offloading on NVPTX target

Shilei Tian via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 18 15:15:11 PST 2021


tianshilei1992 created this revision.
tianshilei1992 added reviewers: jdoerfert, JonChesterfield, ABataev, grokos.
Herald added subscribers: guansong, yaxunl.
tianshilei1992 requested review of this revision.
Herald added subscribers: cfe-commits, sstefan1.
Herald added a project: clang.

In current implementation of `deviceRTLs`, we're using some functions
that are CUDA version dependent (if CUDA_VERSION < 9, it is one; otheriwse, it
is another one). As a result, we have to compile one bitcode library for each
CUDA version supported. A worse problem is forward compatibility. If a new CUDA
version is released, we have to update CMake file as well.

CUDA 9 has been released for three years. Instead of using various weird tricks
to make `deviceRTLs` work with different CUDA versions and still have forward
compatibility, we can simply drop support for CUDA 8 or lower version. It has at
least two benifits:

- We don't need to generate bitcode libraries for each CUDA version;
- Clang driver doesn't need to search for the bitcode lib based on CUDA version.

We can claim that starting from LLVM 12, OpenMP offloading on NVPTX target requires
CUDA 9+.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D97003

Files:
  clang/include/clang/Basic/DiagnosticDriverKinds.td
  clang/lib/Driver/ToolChains/Cuda.cpp
  clang/test/Driver/Inputs/libomptarget/libomptarget-nvptx-cuda_80-sm_20.bc
  clang/test/Driver/Inputs/libomptarget/libomptarget-nvptx-cuda_90-sm_20.bc
  clang/test/Driver/openmp-offload-gpu.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97003.324789.patch
Type: text/x-patch
Size: 7183 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210218/2603c06e/attachment.bin>


More information about the cfe-commits mailing list