Open williamlzw opened 1 year ago
You don't convert anything, it is the same code. The only thing that changes when porting a C++/Cuda application to ManagedCuda, is the host code that is calling your kernel as it is now written in C#, the kernel code itself remains untouched. Using standard Nvidia Cuda toolchain (nvcc) you compile the kernels to PTX or cubin, and then you load the kernels in C# host code. Even though the samples haven't been updated for a while, you still can use them as the basics didn't evolve over time. Have a look at VectorAdd for the host code and VectorAddKernel for the kernel code.