.net interoperability

Hi everybody,

I am a new member on CUDA forum, I work in the Laboratory of Plasma Physics (LPP). I would like to Promote CUDA in this lab, so in some weeks I wil make for them a smal presentation of CUDA.

First of all I have to make somes demo to show how fast it is and if it is easy to write code with this API. But I would like to use Visual studio .net (C# and VB) I make some codes with GAS’s CUDA.NET and the issue is that CUDA.NET isn’t open source and it isn’t easy to make complex code in GPU, I just try CUFFT methode…
That why I would like to make my own .NET DLL (it will be open source), so I will be able to write in C/C++ complex computing code without always switching from managed code to unmanaged code(like it seams to be in CUDA.net). So I would just have write in VB# or VC# .NET the graphical interface(with PLOTLAB.NET).

I’ve started to write this DLL but I don’t realy understand how to use NVIDIA Types in my DLL I can’t convert any pointers from .net managed environement to my C/C++ code (I tried with cucomplex struct it doesn’t whant to convert any pointer of a structure of float to cucomplex).

Does somebody know how could I do or how GAS did to make visible CUDA’s type to .net code?
Maybe should I make a simple win32 DLL and then wrap in VB.NET class?

Thanks.

Hi,

CUDA.NET is a relatively simple wrapper around the native CUDA libraries. You can use .NET Reflector to look at how CUDA.NET is written.

RoBiK

Technically, because CUDA.NET is a closed-source project, that’s reverse-engineering…something that is prohibited in some countries. It’s definitely not a good idea to do it if you’re planning to write your own .NET project with CUDA, because of the licensing issues that could be involved. If you don’t believe me, look at the developer guidelines for the Mono project (mono-project.com), and what they have to do to keep themselves out of the way of Microsoft’s legal team.

OK thanks if I am not alowed to do this I will not use… But my first question is to know how to write in C++ a simple class whith take as argument a cufftcomple (for exemple) and .NET complient. Because this complier looks too secure he doesn’t what to convert any type or struct or class pointer.