clang-omp / clang

clang with OpenMP 3.1 and some elements of OpenMP 4.0 support
clang-omp.github.com
Other
91 stars 15 forks source link

CUDA plus OpenMP #81

Closed DavidPoliakoff closed 8 years ago

DavidPoliakoff commented 8 years ago

Please excuse if this is in the wrong tracker, it might need to be in the CUDA or OpenMP section (in fact, I'll file an issue there as well)

I have a file without any OpenMP in it, and if I try

clang++ [cuda args] -x cuda -std=c++11 --cuda-gpu-arch=sm_30 -stdlib=libc++ b.cpp

it is successful. If on the other hand I try

clang++ [cuda args] -x cuda -std=c++11 --cuda-gpu-arch=sm_30 -stdlib=libc++ -fopenmp b.cpp

I get

error: The target 'nvptx64-nvidia-cuda' is not a supported OpenMP host target.

It appears that Clang only sees that I am using a CUDA backend and am using the OpenMP flag, not checking whether any OpenMP code actually needs to go to the PTX backend (if you're unfamiliar with CUDA, the task of solving this would mean making sure no functions called in an OpenMP region have the device or global attributes). Much like the Sandia folks, we're writing portable parallel programming models and would really love to put Clang through its paces, but if we can't write code where CUDA sections follow OpenMP ones, we won't be able to.

sfantao commented 8 years ago

Hi David,

This bug is meant for the upstream implementation, as you posted in https://llvm.org/bugs/show_bug.cgi?id=28723.

I don't think the one here even has CUDA support, so I'm closing it.