CUDA and openMP on a Mac?

I am a newbie to both CUDA and openMP. Over the past couple of months I have been teaching myself CUDA. Part of the model that I have been developing has to be done on the CPU due to write after read errors. Fortunately I can multitask by launching the time step kernel again while I am performing the necessary calculations on the CPU so that hides some of the CPU calculation time. What I would like to do is use openMP to take advantage of my MacPro’s 8 processors to reduce the time of CPU only portion of the calculations. I tried installing the latest version of gcc on my Mac and was able to do the simple “hello world” example with openMP. Unfortunately the latest version of gcc seems to cause problems with textures in CUDA at compile time. Has anyone out there has successfully got CUDA running with openMP on a Mac?

Thanks in advance for any help any of you can give me.

I have done this on a Linux system, which might be applicable here. Some background: On my Linux systems (RHEL5), the default compiler is 4.1.2, which does not support OpenMP. I also installed a build of gcc 4.2 from AMD which had OpenMP support backported from the 4.3 branch, and some enhancements for the newest AMD processors. However, the version of CUDA I was using didn’t work with gcc 4.2.

The solution was to setup my path to point at the gcc 4.2 binaries, but then to pass the -ccbin=/usr/bin (location of gcc 4.1) to nvcc. All CUDA files were compiled with gcc 4.1, and everything else in my program was compiled with gcc 4.2. This should also work for you as long as you don’t want to use OpenMP inside of a .cu file.

I’ve got gcc4.4 installed on my MBP, and am having the same difficulty, of nvcc trying to build using the system default version of gcc (4.0) which does not support openmp. The binary for gcc 4.4 is named gcc-mp-4.4, and is in my /opt/local/bin directory. I tried passing the -ccbin flag inside xcode, but nvcc won’t recognize any of the gcc 4.4 binaries (I presume because the name is not simply ‘gcc’). How do I point it to a specific binary?