[OpenMP][NVPTX] Drop dependence on CUDA to build NVPTX `deviceRTLs`
authorShilei Tian <tianshilei1992@gmail.com>
Wed, 27 Jan 2021 01:21:27 +0000 (20:21 -0500)
committerShilei Tian <tianshilei1992@gmail.com>
Wed, 27 Jan 2021 01:21:36 +0000 (20:21 -0500)
commite7535f8fedb5f355c332df9f2a87ebd61c82d983
tree4dd841e6df024676de7666d96babba968a6e5fcc
parente1d6178951de20b67950039470ac99377b29ddc7
[OpenMP][NVPTX] Drop dependence on CUDA to build NVPTX `deviceRTLs`

With D94745, we no longer use CUDA SDK to compile `deviceRTLs`. Therefore,
many CMake code in the project is useless. This patch cleans up unnecessary code
and also drops the requirement to build NVPTX `deviceRTLs`. CUDA detection is
still being used however to determine whether we need to involve the tests. Auto
detection of compute capability is enabled by default and can be disabled by
setting CMake variable `LIBOMPTARGET_NVPTX_AUTODETECT_COMPUTE_CAPABILITY=OFF`.
If auto detection is enabled, and CUDA is also valid, it will only build the
bitcode library for the detected version; otherwise, all variants supported will
be generated. One drawback of this patch is, we now generate 96 variants of
bitcode library, and totally 1485 files to be built with a clean build on a
non-CUDA system. `LIBOMPTARGET_NVPTX_COMPUTE_CAPABILITIES=""` can be used to
disable building NVPTX `deviceRTLs`.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D95466
openmp/README.rst
openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake
openmp/libomptarget/cmake/Modules/LibomptargetNVPTXBitcodeLibrary.cmake [deleted file]
openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt