Using OpenMP and CUDA with Visual Studio

To exploit OpenMP under C++ and using Visual Studio 2010 or 2013 you need two steps:

1) #include <omp.h>
2) Project -> Properties -> Configuration Properties -> C/C++ -> Language ->  Open MP Support and then select Yes (/openmp).

To exploit OpenMP under CUDA and using Visual Studio 2010 or 2013 you need some more hacking.
In particular, you need the additional step:

3) Go to C:Program FilesNVIDIA GPU Computing ToolkitCUDAv5.5bin, open nvcc.profile as Administrator and change
INCLUDES += “-I$(TOP)/include” $(_SPACE_)
 
to
 
INCLUDES += “-I$(TOP)/include” “/openmp” $(_SPACE_)

One thought on “Using OpenMP and CUDA with Visual Studio

  1. matthewphilipdixon says:

    OMG thank you!
    This is still valid in Visual Studio 2017 (v140 tools) and CUDA 9.2.

    Worked Great!

Leave a Reply

Your email address will not be published. Required fields are marked *