views:

175

answers:

4

Hi all

With .Net 4.0 coming up, and the new parallel extensions, I wondered if the CLR will be able to optimize and push some calculations to the GPU? Or if any library which can help with the task exists?

I'm no GPU programming expert at all, so forgive me if this is a silly question. Maybe the CLR doesn't support interfacing to the GPUs instruction-set? Are they too primitive, or simply out of scope?

Thanks in advance.

[EDIT] Just to clarify: I know about CUDA and similar libraries, but I want to know if there's a pure .Net solution, and if so, can it work behind the scenes for you, or do you need to do explicit coding?

+1  A: 

I'm not aware of the Parallel Extensions library doing anything on GPUs.

I wouldn't be surprised to hear that MS is researching it, but I don't believe there's anything like that as part of .NET 4.0. Parallel Extensions is still extremely cool, mind you.

Jon Skeet
Hehe, english ain't my native tongue, and for some reason I had a brainblock on the right wording. Updated the question, and thanks for the answer :)
cwap
Edited my answer appropriately :)
Jon Skeet
+5  A: 

There is nothing integrated in .NET related to that.

But I think this is what you're looking for (can use in .NET) ;) :

http://research.microsoft.com/en-us/projects/Accelerator/

also FYI: http://brahma.ananthonline.net/

Lukas Šalkauskas
Both looks interesting. Thanks :)
cwap
np :) I hope it will help you.
Lukas Šalkauskas
+2  A: 

CLR only targets CPUs (Microsoft's Research OS Helios is tasked with support of GPUs at the CIL level through heterogeneous execution).

So the only alternative for now is to use one of those libraries:

Microsoft Research Accelerator project:

It provides a simplified programming of GPUs via a high-level data-parallel library (project is in its v2.0 now).

There's a good article here: http://tomasp.net/articles/accelerator-intro.aspx

Brahma:

Uses C# 3.0's LINQ syntax to specify streaming transformation of data.

Stringer Bell
+2  A: 

XNA is for graphics but you can render to offscreen surfaces and use vertex and pixel shaders so you could use it to run GPU code to perform calculations. It would be fairly difficult though and require a lot of low level packing of data and writing of shader code.

John Burton