.netparallel-processinggpgpuopencl.net

GPGPU Programming in .Net - Microsoft Accelerator VS OpenCL.net [VS Others]


I am developing a program (in .Net) that has a lot of image processing (like 2D Convolutions, ...) and I want to do them with GPGPU (parallel processing) So, I have some choices: Microsoft Accelerator, OpenCL.Net, ... Which one is better for me?

Some things important for me: Speed, Compatibility (e.g. if GPU does not support that, what happens?), Easy to learn, Work with both Nvidia and ATI , ...

And I heard that I can create my own function in OpenCL and run it for many array cells, but I don't know if I can do that in Microsoft Accelerator or I have to work with its functions...


Solution

  • Microsoft Accelerator and OpenCL support both CPU and GPU, and are vendor-independent (i.e. runs on both ATI and nVidia cards).

    In case of OpenCL, you would have to separately install OpenCL to user machines (included in nVidia (supports nvidia's gpus) and ATI (supports ati gpus and any cpus) drivers, downloadable for Intel (support cpus). However, you could just keep AMD's OpenCL.dll bundled with you software to use as CPU-fallback. OpenCL is more developed (more features, less bugs): it has appeared earlier, is cross-platofrm and based on existing technologies (CUDA, Brook+). OpenCL allows you to finely control what you actually do, so it's faster, but a little more difficult.

    Microsoft Accelerator, as I got it, runs on any GPU with DirectX support (== any modern GPU) and any 64 bit CPU. It integrates more smoothly into existing code (no additional files and tons of library calls), but this is not good for performance. MS Accelerator would allow you to quicker implement your functions (it looks quite simple), so it might be good start. But if it doesn't show great performance, you should still give OpenCL a try, it could do better.

    So, I would advice you to learn OpenCL, since: 1) OpenCL is closer to GPU hardware architecture, so a) it allows you to achieve better performance, b) you could write more sophisticated code, c) you would learn how it all works; 2) There are more information/tutorials/hacks on the Internet; 3) It's cross-platform (might not be great feature in your case, but still); 4) OpenCL is very similar to CUDA, so you would learn two GPU-related technologies at once.