Page MenuHomePhabricator

[Clang][OpenMP] Require CUDA 9.2+ for OpenMP offloading on NVPTX target
ClosedPublic

Authored by tianshilei1992 on Feb 18 2021, 3:15 PM.

Details

Summary

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

Diff Detail

Event Timeline

tianshilei1992 created this revision.Feb 18 2021, 3:15 PM
tianshilei1992 requested review of this revision.Feb 18 2021, 3:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 18 2021, 3:15 PM
tianshilei1992 edited the summary of this revision. (Show Details)Feb 18 2021, 3:20 PM

Could you include the simplifications this allows in the openmp subfolder? If it's too much put it in a child revision.

Could you include the simplifications this allows in the openmp subfolder? If it's too much put it in a child revision.

I prefer to split them as most of changes are in OpenMP.

This change makes much sense. In fact, CUDA 8 was so problematic for use with the nvptx runtime that (if memory serves me well) we declared it unsupported. So essentially this patch drops support for CUDA version 7 (and lower), which is already six years old. If the other reviewers agree, we can accept the patch.

This revision is now accepted and ready to land.Feb 18 2021, 3:52 PM

According to D97012, if we want to completely drop CUDA version, it should be CUDA 9.2. Do we want to change the minimum version to CUDA 9.2?

tianshilei1992 retitled this revision from [Clang][OpenMP] Require CUDA 9+ for OpenMP offloading on NVPTX target to [Clang][OpenMP] Require CUDA 9.2+ for OpenMP offloading on NVPTX target.Feb 19 2021, 6:37 PM
tianshilei1992 edited the summary of this revision. (Show Details)

Update to CUDA 9.2

Use CUDA 9.1 for failure test

Harbormaster completed remote builds in B90009: Diff 325133.

fixed the test

update test case

optimize error handle process

If there is no objection, I’ll merge it.