Cuda with user interface

Hi All,
I am new to cuda. I was able to build a simple console using vs2010 but am wondering if there is a way to put a user interface to go with it.
Something like:

  • a form within the cuda program
  • or turn the cuda program into a dll and let a windows forms application to call it
    Any help would be appreciated…
    Thanks,
    DWH

I usually use cuda on C# application as follows

  • make a cuda wrapper llibrary with C++/CLI (to be callable from C#)
  • make a UI with C# then call the wrapper to use cuda

…or make UI(by Windows Forms) and cuda-used functions with both C++/CLI

Hi episteme,
Can you please share some more lights? I am familiar with C# calling C++ dll. I have been trying to add the cuda codes in a regular but I wasn’t able to get it to compile.

This was my latest error:
error MSB3721: The command ““C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5\bin\nvcc.exe” -gencode=arch=compute_20,code="sm_20,compute_20" --use-local-env --cl-version 2010 -ccbin “C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin” -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5\include” -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5\include" -G --keep-dir Debug -maxrregcount=0 --machine 32 --compile -cudart static -g -DWIN32 -D_DEBUG -D_WINDOWS -D_USRDLL -DCPPDLL_1_EXPORTS -D_WINDLL -D_UNICODE -DUNICODE -Xcompiler “/EHsc /W3 /nologo /Od /Zi /RTC1 /MDd " -o Debug\kernel.cuh.obj “G:\VS Projects\z_VS_CS\CPP Components\CPPDLL_1 - Copy\CPPDLL_1\kernel.cuh”” exited with code 1.

Thanks,
DWH

I don’t see such error.

here is small solution: C# console app. calls CUDA(wrapped by C++/CLI)

http://1drv.ms/1Qr7sQ0

Thanks episteme.
It seems I have problem opening your projects.
May I ask which version of VS and cuda sdk you used?
Thanks again.

Visual Studio 2013 and CUDA 7.0/7.5

this solution you’ve got is for CUDA 7.0.

you can change CUDA 7.0 to 7.5 with right-click project CUDA.Saxpy on Solution Explorer, Build Dependencies → Build Configuration.

Hi episteme,
Thanks for all your help.
It works.

also, you can use cuda directly from C#: http://devblogs.nvidia.com/parallelforall/accelerate-net-applications-alea-gpu/

I like to use managedCuda managedCuda