Greatly increase support for GPU programming in C#
-Support GPU programming in C# -both general and graphical- on at least equal level with C++. On every Microsoft platform.
-Design the future versions (or successor) of DirectX with C# in mind.
Or just move to F# - http://fsharp.org/use/gpu/
No need for Microsoft to be the first mover here - if you want to make a framework for doing this or contribute to the C#/F# frameworks listed on the above page your more than welcome. More contributors to open source frameworks to do this would be great - IMO C# and F# already support features that make it possible to compile/translate .NET code into GPU code (expressions, quotations)
This can be done in managed way and without corrupting debuging expirience.
Look at Cudafy:
They support debugging via emulation, all GPu cards and CPU (OpenCL) and NVidia (CUDA).
So basically you would write functions as usual but decorated with some attribute:
static void SomeFunc(CLThread thread, int someParam)
//normal C# code
Ben Voigt [Visual C++ MVP] commented
.NET is highly intertwined with a runtime, dynamic memory allocation, garbage collection. The experience on the GPU wouldn't be the same at all. You're going to have to write GPGPU code as C-with-classes anyway... wouldn't better integration of C++AMP into C# be as good as trying to create a C#-AMP?
Miha Markic commented
Perhaps a good option is to use C++ AMP stuff (http://msdn.microsoft.com/en-us/library/hh265137.aspx) in a separate library and create a managed wrapper around it that communicates the minimum possible data. BTW I've made C# framework for doing GPU a while back ago. It was like you were programming in C# using a custom C# library and the generated code would be compiled for the GPGPU during compilation time. It was working but later hadn't have time to push it forward.
i think the xna5 ,
.net in xbox one
or Sim d
is better to place your votes
Lionel Bernard commented
I wished to see a new version of Managed DirectX, from Microsoft, on 1 january 2013! ;-)
Gary Birch commented
The capability of writing GPGPU code for various types of calculations should be available to all .Net languages i.e. VB, F#, etc... not just C++ programmers. I would also like to see layers of abstraction added to the stack to allow other capablilties with data types other than integers and float types. In particular allowing the use of Strings in arrays along with the implementation of their related functions would provide extremely useful capabilities for development in all languages.
Timmothy Posey commented
+3. OpenCL is being done by Java, why can't C# do the same?
Use SharpDX, I have been using it for almost 18 months and it is great, it gets updated frequently and the support / performance is great, if you actually look at Win8 development (although SharpDX can be used with XP / 7 depending on DX version you want to support) MS do in fact recommend using it.
It is also opensource and free, maybe MS could help with advertising. Oh and SharpDX is also available via NuGet
Farhan Khan commented
Gavin Williams commented
Both SlimDX and SharpDX provide the ability to use DirectX from C#, they are both excellent wrappers. I noticed SharpDX was mentioned at Build. But Microsoft needs to accept that people want to program in C# and have full access to DirectX. So either provide an ongoing managed wrapper, that is maintained with DirectX or provide some support for these independent projects. They do need support. And why not encourage people to use those wrappers ? Instead of telling people that C++ is how games should be made on Windows now, because a lot of people don't want to program in C++.
I believe WPF has GPU support for the GUI.
What else is needed?
Please give us DirectX in C# on Windows 8, Metro and on Windows Phone 7.8, 8.0!
Nowadays c# programming are very popular especailly unity3d etc.. Lot of free resources http://csharp.net-informations.com available on net for new comerce. Also in the job market c# is highly demended language now.
Tom Spilman commented
Anyone that wants DirectX in C# should just go grab SharpDX (http://www.sharpdx.org). It is an excellently thin C# wrapper around DirectX.
If you want XNA in Metro then go look at MonoGame (http://monogame.codeplex.com) which current has Metro support working in a development branch.
While it would be nice for MS to provide an official DirectX binding for C#... it isn't necessary.
Miha Markic commented
freefallr, you know, everything is possible even with a Turing machine. However, it doesn't mean it can't be done easier. Thus I fully agree with OP that it is a shame that MS is steering .net away from DirectX and GPUs. Once there was a Managed DirectX, then it was a semi official Windows API Code Pack and now there is nothing left (apart from 3rd party libraries of course).
If you want to utilize the GPU, then you'll need to learn to write shaders. Shaders have evolved from asm like language into C like languages. But they're not part of C++, they never have been.
Their difficulty lies in the need to know _a lot_ of theory to get the best from them.
C++ has no monopoly on invoking shaders. I've managed to avoid the managed languages up to now, but I assume that you can load libraries and execute functions contained therein, and I know you can use COM from C# (I've created COM objects for C# developers before).
In order to execute shaders, you do so through OpenGL or DirectX. So utilize those APIs and stop complaining.
Robert Dyball commented
Ideally have it support different graphics cards - both AMD + nVidia, not be specific to one platform.