Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CUDA C# .Net Example Project? VS2010

Tags:

c#

.net

cuda

I would like to know if anyone has an example CUDA C# .Net project that works with VS 2010. I am running all 64 bit and CUDA 4.0.

I tried the following:

GPU .Net - failure, their application won't install due to proxy license issue

Cudafy - failure, samples would not run because of error message 'vsvars32.bat is missing' although I am targeting x64 (I think this must be an issue with either Cudafy code or nvcc.exe'

GASS .Net - failure, they have a .dll and a manual, but no sample project (that I could find) and their manual has no walkthrough (jumps straight in to technical features, it's not a primer)

Having no luck with VS2010, I switched to VS2008 and VC++:

http://llpanorama.wordpress.com/2010/06/18/cuda-gets-easier/ ...however his example falls flat because the cuda.rules file is no longer in cuda 4.0 making impossible to complete his walkthrough (at least with 4.0).

I also tried a myriad of blog examples, forums, and other google related look-ups. So far, all attempts have resulted in failure. However, I am able to execute the sample libraries that came with the SDK. These are written for VS2010 and VC++. I want to get this working with C#.

like image 489
sapbucket Avatar asked Oct 26 '11 00:10

sapbucket


People also ask

What is CUDA C?

CUDA C is essentially C/C++ with a few extensions that allow one to execute functions on the GPU using many threads in parallel.

Does CUDA support C?

CUDA (Compute Unified Device Architecture) is a parallel computing platform and programming model by NVidia. It provides C/C++ language extensions and APIs for working with CUDA-enabled GPUs.

Is CUDA C or CPP?

CUDA provides C/C++ language extension and APIs for programming and managing GPUs. In CUDA programming, both CPUs and GPUs are used for computing. Typically, we refer to CPU and GPU system as host and device, respectively.

Where is CUDA C used?

Using the CUDA Toolkit you can accelerate your C or C++ applications by updating the computationally intensive portions of your code to run on GPUs. To accelerate your applications, you can call functions from drop-in libraries as well as develop custom applications using languages including C, C++, Fortran and Python.


2 Answers

CUDA.NET has not been maintained for quite some time and no longer works with the latest CUDA versions (primarily due to 64-bit pointers and the introduction of new _v2 suffixed functions not being picked up by dllimport). We tried contacting the company behind it and never got any replies. Since there are no license restrictions we updated the source and it is embedded in CUDAfy.NET. This is an open source project (LPGPL) that builds on CUDA.NET and simplifies its use further. CUDAfy website There are also a few tutorials on codeproject including: Using Cudafy for GPGPU Programming in .NET

like image 165
Nick Avatar answered Sep 17 '22 12:09

Nick


I didn't find much, but there is documentation on it:

CUDA.NET Documentation

Also, there's this question and answer here on SO:

Hello-world for CUDA.Net

like image 29
Tim Avatar answered Sep 20 '22 12:09

Tim