[libomptarget] Build cuda plugin without cuda installed locally
authorJon Chesterfield <jonathanchesterfield@gmail.com>
Sat, 23 Jan 2021 00:15:03 +0000 (00:15 +0000)
committerJon Chesterfield <jonathanchesterfield@gmail.com>
Sat, 23 Jan 2021 00:15:04 +0000 (00:15 +0000)
commit47e95e87a3e4f738635ff965616d4e2d96bf838a
treea4a5ca41f26b04c2a22ea30e24efb9fbc95dca50
parentad25bdcb8e4e9459886062d3855a5971af758731
[libomptarget] Build cuda plugin without cuda installed locally

[libomptarget] Build cuda plugin without cuda installed locally

Compiles a new file, `plugins/cuda/dynamic_cuda/cuda.cpp`, to an object file that exposes the same symbols that the plugin presently uses from libcuda. The object file contains dlopen of libcuda and cached dlsym calls. Also provides a cuda.h containing the subset that is used.

This lets the cmake file choose between the system cuda and a dlopen shim, with no changes to rtl.cpp.

The corresponding change to amdgpu is postponed until after a refactor of the plugin to reduce the size of the hsa.h stub required

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D95155
openmp/libomptarget/include/dlwrap.h [new file with mode: 0644]
openmp/libomptarget/plugins/cuda/CMakeLists.txt
openmp/libomptarget/plugins/cuda/dynamic_cuda/cuda.cpp [new file with mode: 0644]
openmp/libomptarget/plugins/cuda/dynamic_cuda/cuda.h [new file with mode: 0644]