I'm trying to write a childish app with CUDA.Net, but I'm out of luck.
I've figured out to:
using GASS.CUDA;
// ...
var c = new CUDA();
// c.Launch(myfunc); // ???? how ???
myfunc
apparently should be of type GASS.CUDA.Types.CUfunction
but I didn't find how to define one.
First you need a .cu file with your kernel (function to be executed on a GPU). Let's have a file mykernel.cu:
This have to be compiled into a .cubin file with the nvcc compiler. In order to let the compiler know of the Visual C++ compiler, you need to call it from within the Visual Studio Command Prompt:
This creates the mykernel.cubin file in the same directory.
Then in a C# code you can load this binary module and execute the kernel. In the higher-level object API of GASS.CUDA it can look like this:
That's it!
The nvcc compiler should be called as a build action better than calling it by hand. If anyone knows how to accomplish that, please let us know.