mixing openmp and CUDA fortran

Is it possible to use openmp and CUDA fortran in the same code?
For example, is it possible to parallelize the outer loop with openmp, and the inner one with CUDA?

Hi goblinqueen,

You should be able to use OpenMP in CUDA Fortran. However, the OpenMP directives can only be used in host code. Also, you will need to use the “cudaSetDevice” function in your OpenMP region to set which thread gets which device.

Hope this helps,
Mat

Hi Mat,
thank you very much! I’ll try it!