Trying to find some material or resources regarding using CUDA from C#, some code examples or how to’s. I am aware of cudanet from [url=“http://www.hoopoe-cloud.com/”]http://www.hoopoe-cloud.com/[/url] but I was wondering if there’s another way of doing it. Since I’ve already implemented kernels and host functions calling the kernels I would like to find a way to call my host functions from C# instead of having to rewrite all of my host functions to C#.
Well, if you’ve already done all of the host-side code in the native DLL/EXE, then all you need to do is add some P/Invoke signatures in your C# code to call into the native DLL. Search Bing/Google/DuckDuckGo for “Platform Invoke”, “Native Interop”, or “DllImport attribute” and you’ll find what you need.
Well, if you’ve already done all of the host-side code in the native DLL/EXE, then all you need to do is add some P/Invoke signatures in your C# code to call into the native DLL. Search Bing/Google/DuckDuckGo for “Platform Invoke”, “Native Interop”, or “DllImport attribute” and you’ll find what you need.
A .cubin file only contains device-based code, so that wouldn’t do anything for the host-side stuff you’ve written. You need to just compile everything into a DLL (which you’ll use nvcc and Visual Studio for, but I don’t know what command line you’ll need to do it).
A .cubin file only contains device-based code, so that wouldn’t do anything for the host-side stuff you’ve written. You need to just compile everything into a DLL (which you’ll use nvcc and Visual Studio for, but I don’t know what command line you’ll need to do it).