cuda with mingw - updated

We have been developing our code in linux, but would like to compile a windows executable. The old non-gpu version compiles just fine with mingw in windows, so I was hoping I'd be able to do the same with the CUDA version.

The strategy is to compile kernel code with nvcc in visual studio, and the rest with gcc in mingw.

So far, we easily compiled the .cu file (with the kernel and kernel launches) in visual studio. However, we still can't compile the c code in mingw. The c code contains cuda api calls such as cudaMalloc and cuda types such as cudaEvent_t, so we must include cuda.h and cuda_runtime.h. However, gcc gives warnings and errors for these headers, for example:

../include/host_defines.h:57:0: warning: "__cdecl" redefined

and

../include/vector_functions.h:127:14: error: 'short_4' has no member named 'x'

Any ideas on how we can include these headers and compile the c portion of the code?

7
задан jmilloy 13 May 2011 в 19:06
поделиться