Two steps forward, one step back…

Campy is moving forward, albeit slowly. I have written new classes that models the C++ AMP more fully, and have a run code for a simple “Hello World” example on a NVIDIA GPU.

As it turns out, the package I was using, ManagedCUDA, won’t support Net Standard until that comes out, which might be Fall 2017–but maybe never, as I have checked Net Core 2.0/Net Standard Pre-release 1, and the Net Standard 2.0 package does not work on a simple example. So, I will be taking extra time to write an SWIG-generated library for the CUDA Driver API. It’s likely I will need a similar AMD GPU driver library as well but will do that after a release of Campy that works with NVIDIA GPUs.

In the meanwhile, I learned that there is another library available that is similar to Campy, namely ILGPU. It looks similar, but IMHO it is missing pieces of the C++ AMP programming model. However, you might want to look at that.

–Ken Domino

Inching towards an LLVM backend

Several months ago, I started working again on Campy. Since then, I’ve had to rewrite quite a bit of the source in order to make use of LLVM for code generation. So, Campy can now compile and execute a good subset for an x86/x64 target, which is a small but important step towards the goal of executing C# on a GPU. A significant part of the work was simply exposing a C# wrapper library for LLVM. That wrapper class targets Windows, Ubuntu, and Android, which as far as I can tell surpasses anything offered in NuGet. That library is Swigged.llvm, which you can find here.

The next few steps are to refine the compiler further and to target a NVIDIA GPU. In addition, I will need to write a layer to expose the SSA analysis in LLVM in order to take advantage of that to determine what functions/methods must be compiled for the GPU. There is much work to be done, but it is worth the effort.