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_)

Leave a Reply

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