What's the difference between ManagedCuda and Campy
Hi @kaby76 Could you explaine a little bit about the difference betwee ManagedCuda and Campy? I'm just confusied to choose.
Sorry for the delay. I've been sick for several days.
ManagedCuda is a C# API to access the CUDA Driver API. If you know the CUDA Driver API, using ManagedCuda is not much of a jump. You write CUDA C++ code, compile that with NVIDIA's GPU Toolkit, then run it through the CUDA Driver API.
On the other hand, Campy is a compiler and runtime for the GPU. In Campy, the C# code is compiled into MSIL/CIL by the C# compiler. Campy performs a JIT compile of the code when it starts to execute a Parallel.For() method call. The compiler performs a transitive closure of all calls that it finds in the user code, and adds all that to the set of all JIT compiled code that is loaded on a GPU through the Driver API. The problem is that some methods are not MSIL/CIL, rather x86, which could be converted to PTX (e.g., Ocelot), then run on the GPU.
Campy sounds great, but in practice, it's not practical yet. In fact, there isn't any compiler for GPU that solves the problem (Campy, Aleagpu, ILGPU, or Altimesh). The problem is that there isn't a full virtual machine and runtime that runs on the GPU. For Campy, I ported the DotNetAnywhere runtime to CUDA C++, including the meta type system, memory allocation and garbage collection. But, it's not "official". Ideally, the runtime should be in C#.
I am trying to port NET Core to the GPU. Unfortunately, much of that is written in C++, e.g., the memory allocator/GC, the type system, etc. I was going to try to port the 2+ million lines of NET Core C++ code to C# by hand, but this would take years. The only way to do that is with a program transformation system. So I am writing one called Piggy.
Note, ManagedCuda itself hasn't officially ported to Net Standard, so there are a number of forks of it with this modification.