[Clang][OpenMP] Allow unified_shared_memory for Pascal-generation GPUs.
authorMichael Kruse <llvm-project@meinersbur.de>
Thu, 13 May 2021 22:12:23 +0000 (17:12 -0500)
committerMichael Kruse <llvm-project@meinersbur.de>
Thu, 13 May 2021 22:15:34 +0000 (17:15 -0500)
commit83ff0ff46337422171fb36f934bd56c2bc1be15c
tree24e7e67bf37944a2ab968a4ca1953e3f0ed4672c
parent93d56922fabaf52eec8d1d4e28e04fa47eb1c797
[Clang][OpenMP] Allow unified_shared_memory for Pascal-generation GPUs.

The Pascal architecture supports the page migration engine required for
unified_shared_memory, as indicated by NVIDIA:
 * https://developer.nvidia.com/blog/unified-memory-cuda-beginners/
 * https://developer.nvidia.com/blog/beyond-gpu-memory-limits-unified-memory-pascal/
 * https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#um-requirements

The limitation was introduced in D54493 which justified the cut-off by
the requirement for unified addressing. However, Unified Virtual
Addressing (UVA) is already available with sm20 (Fermi, Kepler,
Maxwell):
 * https://docs.nvidia.com/cuda/gpudirect-rdma/index.html#basics-of-uva-cuda-memory-management

Unified shared memory might even be possible with these, but with
migration of entire allocations on kernel startup.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D101595
clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp
clang/test/OpenMP/requires_codegen.cpp