VS2008 Form GUI and CUDA Using Cuda with a Forms based GUI in xp

Hi,

Brand new at CUDA programming so please bear with me. I finally got cuda to work in console application using Visual studio 2008 on win xp (32 bit). But my main target is to port an existing program to port to cuda. This program is very computational intensive and is based on a complex gui. So, porting to cuda makes sense as it will cut down on my computational time significantly. I did some research and found no example where cuda is used with a forms based application. Its always been with a console application. But converting my gui into a console based application will be out of the question.

So, I tried doing a test (forms based gui) where I included the .cu file in my project. But on compile i get this linker error

fatal error LNK1313: ijw/native module detected; cannot link with pure modules

So I guess cuda doesn’t play nice with managed code. My question is: IS there anyway to use cuda with a form in visual studio 2008?

Another question: Has anyone even tried this as I have not seen any such example?

Please help…

Edit:–
Ok I changed the the properties->configuration->general->common language runtime support to /clr, and it compiled without any problem. But when I tried to run it i got a nasty popup dialog box with Debug Assertion failed error in file dbgheap.c, Expression _CRTisValidHeapPointer(pUserData).

So close but no cigar. Any Ideas???

We set things up so that the main GUI thread manages a thread for each GPU.

Whenever we want to see (visualize/render) results, the main thread (host)

harvests data from each GPU. Some basic thread management is required.