Merging MFC with CUDA

Before I ask, I will raise my hand and admit that I am a newb to all this. So I am sure my questions are extremely naive, but here it goes.

I want to write a MFC project that calls my 5600 to do the heavy lifting on some edge detection and convolutions. So can anyone give me some instructions on how I can put together a project that can use MFC and CUDA? So far anything I do give me errors on linking or errors before I get to the link.

I have started with a clean MFC project and I can’t figure out what I need to add for the nvcc compiler. I have also started with the cppintergrate project and when I add the include files that my MFC classes need I get hosed with redundant defines.

Any help would be greatly appreciated.

I am currently doing somthing similar, but using Managed C++ and .NET on one end with CUDA on the other.

Being completely untrained at programming i have had no luck at joining the two together in an efficent manner, such as compiling the CUDA into a DLL to call functions from, and have resorted to creating an executable that is called an run from my host program. External Image

This is pretty disgusting but it works. If sombody could give examples of how to connect CUDA to .NET i would be a very very happy person!!!

Tom

The easiest way is to wrap your CUDA functions in a dll file. Then you can call
your cuda function from either .NET or MFC same as other functions.

Before CUDA1.0 there is an error for using CUDA as dll for .NET. So make sure you are using the latest version of CUDA SDK.

  • Leoon.