oh yeah, it's possible to compile CUDA code with Mingw although Nvidia says that it's not supported.
indeed it's only a matter of linking libraries so why should exist limitations?
I premise that probably is possible to do this stuff easier so maybe I could update the post in future.
the first problem is that gcc/g++ doesn't like the CU extension of the files so it's enough to rename them as C or CPP and so on.
now open the file c:\cuda\include\host_defines.h and add a __stdcall at the line 59 like the following:
Code:
#define CUDARTAPI __stdcall
and now compile your code normally, example:
Code:
g++ -o file.exe file.c -IC:\CUDA\include -I"C:\Documents and Settings\All Users\Application Data\NVIDIA Corporation\NVIDIA GPU Computing SDK\C\common\inc" -L"C:\Documents and Settings\All Users\Application Data\NVIDIA Corporation\NVIDIA GPU Computing SDK\C\common\lib" -LC:\CUDA\lib -lcuda -lcutil32 -lcudart
the paths are those of default so they are valid anywhere.
I have tested bandwidthTest and works so in the next days I can start to burn my 8600gt :)