How use openmp in .cu file ?

Hi, I know this is nearly 2 years late, but I’ve come across this problem, too, and figured out that “what” and the “why.”

The problem is that nvcc assumes a Gnu C compiler, regardless of whether you are using ifc or pgcc as your regular compiler. It sounds like you use ifc/ifcpc, which would normally accept “-openmp”. Use the gcc syntax “-fopenmp” in your nvcc command line instead.

Now, this bring about a whole new series of problems—how to link in the OpenMP libraries when some of your code is compiled with “ifc -openmp” and the Cuda stuff with “nvcc --compiler-options -fopenmp”. Any ideas?