Khyperia's Coding Adventures - Making C# run on the GPU
I just spent the past few hours making a C#/CUDA library.
https://github.com/khyperia/CudaSharp
This library “makes C# run on the GPU”.
It takes .net IL and translates it to LLVM through a (admittedly quite feature lacking) compiler written by me. Then, it takes the LLVM bitcode and translates it to NVIDIA PTX. This PTX then can be uploaded to the GPU and executed.
The library is still an extreme work-in-progress, as I have only just started writing it a few hours ago. ...
A library to make C# run on CUDA-enabled GPUs
This library is currently far from complete and is not intended for general use.
C# is executed on the GPU like so:
Your C# compiler translates C# to .net CIL
Calling the CudaSharp.Translate method reads the CIL, translates to LLVM IR, and compilers to NVIDIA PTX
Use your GPU library of choice (for example, ManagedCuda) to read in the PTX file and execute it on the GPU
For an example usage, see CudaSharpTest/Program.cs
...
As said in the title, this is just a cool project to check out.
No comments:
Post a Comment
NOTE: Anonymous Commenting has been turned off for a while... The comment spammers are just killing me...
ALL comments are moderated. I will review every comment before it will appear on the blog.
Your comment WILL NOT APPEAR UNTIL I approve it. This may take some hours...
I reserve, and will use, the right to not approve ANY comment for ANY reason. I will not usually, but if it's off topic, spam (or even close to spam-like), inflammatory, mean, etc, etc, well... then...
Please see my comment policy for more information if you are interested.
Thanks,
Greg
PS. I am proactively moderating comments. Your comment WILL NOT APPEAR UNTIL I approve it. This may take some hours...