[all-commits] [llvm/llvm-project] 76151a: [Clang][OpenMP] Require CUDA 9.2+ for OpenMP offlo...

Shilei Tian via All-commits all-commits at lists.llvm.org
Mon Feb 22 08:01:00 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 76151acf893ac7bdaf460fdfe8a8494cf477157a
      https://github.com/llvm/llvm-project/commit/76151acf893ac7bdaf460fdfe8a8494cf477157a
  Author: Shilei Tian <tianshilei1992 at gmail.com>
  Date:   2021-02-22 (Mon, 22 Feb 2021)

  Changed paths:
    M clang/include/clang/Basic/DiagnosticDriverKinds.td
    M clang/lib/Driver/ToolChains/Cuda.cpp
    A clang/test/Driver/Inputs/libomptarget/libomptarget-nvptx-cuda_102-sm_35.bc
    R clang/test/Driver/Inputs/libomptarget/libomptarget-nvptx-cuda_80-sm_35.bc
    M clang/test/Driver/openmp-offload-gpu.c

  Log Message:
  -----------
  [Clang][OpenMP] Require CUDA 9.2+ for OpenMP offloading on NVPTX target

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.2 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 9.1 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.2+.

Reviewed By: jdoerfert, JonChesterfield

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




More information about the All-commits mailing list