Hybridizer Essentials

Hybridizer Essentials is a compiler targeting NVidia GPU from C# code or binary. It supports various advanced features of C#, such as Parallel.For, generics or virtual functions. It is not a CUDA wrapper (even if it provides one). It actually compiles a CUDA binary from your scalar C# code.

It now supports commercial licenses! And CUDA 9.2 and CUDA 10.0!

Using parallelization patterns, such as Parallel.For or distributing parallel work by hand, the user can benefit from the compute power of the accelerators without entering the learning curve of the internal architecture jargon:

[EntryPoint]
public static void VectorAdd(double[] a, double[] b, int N)
{
    Parallel.For(0, N, (i) => { a[i] += b[i] });
}

While providing automated default behavior, Hybridizer leaves full control to the developer at each phase, allowing the reuse of existing device-specific code, use of existing external libraries or custom handwritten code snippets.

If debug information is available, the debugging can be performed from within the development environment, while running the optimized code on the target hardware; for example, a program written in C#, with a breakpoint in the cs file within Visual Studio can have that breakpoint hit and its local variables and object data explored while execution occurs on an NVIDIA GPU:

debugging with nsight

Customized integration within more complex projects is made possible. Libraries for which code is not available and/or is obfuscated can also be used as the hybridizer operates on MSIL byte-code; also allowing support for a variety of languages built on top of dot net virtual machine.

All of this flexibility does not come at the expense of performances loss: CUDA source code is generated at build time and compiled with nvcc for optimal performances. As our benchmark illustrate, code generated by the Hybridizer can perform as well as hand-written code, achieving up to 93% of hardware peak performance. Performance profilers such as NSIGHT Visual Profiler can be used to measure performances of the generated binary, where the performance indicators will refer to original source code (C# for instance).

How to get Hybridizer Essentials?

Hybridizer Essentials is available from Visual Studio marketplace. As such, it can be found and installed directly from visual studio :

search for hybridizer essentials

Once installed, query valid license through configuration menu (Tools -> Hybridizer Configuration). Check your emails and validate the license.

validate hybridizer essentials license

Download Samples

We also published samples on our public github. It provides examples of supported C# code, from simple Hello World to more complex code involving generics and virtual functions. It’s tested against Visual Studio 2012, 2013, 2015 and 2017 (warning : Visual Studio 2017 you need the v140 toolset — activate it from Visual Studio Installer). Examples are explained in the wiki section.

Once downloaded, if Hybridizer Essentials is properly configured and license validated, you should be able to compile the whole solution in x64. Pick a project as startup and run it!

For instance, here is what happens with the Mandelbrot example:

mandelbrot

We reach 83% of arithmetic peak on a Geforce 1080 Ti with main stall reason being “Other” :

mandelbrot performances

What’s next?

We will add more samples to our collection (2D arrays, maybe some F#/VB.net…). But more importantly, we wait for your feedback!
Please play with the product at home or the office and tell us about what you’ve been able to achieve with Hybridizer Essentials. If you find any issue, feel encouraged to log an issue on our github.