diff options
author | Joseph Huber <jhuber6@vols.utk.edu> | 2022-02-21 14:39:58 -0500 |
---|---|---|
committer | Joseph Huber <jhuber6@vols.utk.edu> | 2022-04-29 11:38:40 -0400 |
commit | d9c64d33b98be695fc78a65624242033058ed117 (patch) | |
tree | ccc15e9b4c0b7e6a59a60296ed104c0c10e17f34 /llvm/lib/Support/TargetParser.cpp | |
parent | 6aeb2a215ee170a0abbc4a99f75065816fcff744 (diff) | |
download | llvm-d9c64d33b98be695fc78a65624242033058ed117.zip llvm-d9c64d33b98be695fc78a65624242033058ed117.tar.gz llvm-d9c64d33b98be695fc78a65624242033058ed117.tar.bz2 |
[OpenMP] Allow CUDA to be linked with OpenMP using the new driver
After basic support for embedding and handling CUDA files was added to
the new driver, we should be able to call CUDA functions from OpenMP
code. This patch makes the necessary changes to successfuly link in CUDA
programs that were compiled using the new driver. With this patch it
should be possible to compile device-only CUDA code (no kernels) and
call it from OpenMP as follows:
```
$ clang++ cuda.cu -fopenmp-new-driver -offload-arch=sm_70 -c
$ clang++ openmp.cpp cuda.o -fopenmp-new-driver -fopenmp -fopenmp-targets=nvptx64 -Xopenmp-target=nvptx64 -march=sm_70
```
Currently this requires using a host variant to suppress the generation
of a CPU-side fallback call.
Depends on D120272
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D120273
Diffstat (limited to 'llvm/lib/Support/TargetParser.cpp')
0 files changed, 0 insertions, 0 deletions