direct compute with c#
Is it possible to use direct compute with c# 2010 (and if so, where are samples, getting started tutorials, etc.)
Is it possible to use direct compute with c# 2010 (and if so, where are samples, getting started tutorials, etc.)

#1
Posted 01/26/2010 05:04 PM   
[quote name='garyhibb' post='989221' date='Jan 26 2010, 12:04 PM']Is it possible to use direct compute with c# 2010 (and if so, where are samples, getting started tutorials, etc.)[/quote]

I've never heard of a way. If you're working in .NET, the current best solution is to write your device kernels with CUDA, compile them to .cubin or .ptx, and use P/Invoke with the CUDA driver or runtime to call them.
[quote name='garyhibb' post='989221' date='Jan 26 2010, 12:04 PM']Is it possible to use direct compute with c# 2010 (and if so, where are samples, getting started tutorials, etc.)



I've never heard of a way. If you're working in .NET, the current best solution is to write your device kernels with CUDA, compile them to .cubin or .ptx, and use P/Invoke with the CUDA driver or runtime to call them.

GPU.NET: Write your GPU code in 100% pure C#.

Learn more at tidepowerd.com, and download a free 30-day trial of GPU.NET. Follow @tidepowerd for release updates.



GPU.NET example projects

#2
Posted 01/26/2010 06:04 PM   
There are currently no .NET bindings for DirectX 10/11 made by Microsoft, not even the XNA stuff. That's what Wiki says at least (http://en.wikipedia.org/wiki/DirectX#.NET_Framework).

Apparently there's a third party Open Source solution, SlimDX (http://en.wikipedia.org/wiki/SlimDX), that supports Dx 10.1 and has beta support for Dx 11. They note "Although Direct3D 11 support is available, it's new and minimally tested. It would be a good idea to stick with the current Subversion source tree of SlimDX if you're working with it.". I don't know if that support includes compute shaders.

One does not simply walk into P/Invoke. It's a horrid wasteland, many a soul ventured there never to come back. Think twice about entering and have your trusty sword and debugger ready if you do.

You might also try C++/CLI; this .NET Frankenstein interfaces with native C/C++ fairly seamlessly (at the expense of producing code that is a mangled mix of native binary and managed IL) and you should be able to use Dx from there. CUDA not so much (it doesn't work with /MD). OpenCL might work.
There are currently no .NET bindings for DirectX 10/11 made by Microsoft, not even the XNA stuff. That's what Wiki says at least (http://en.wikipedia.org/wiki/DirectX#.NET_Framework).



Apparently there's a third party Open Source solution, SlimDX (http://en.wikipedia.org/wiki/SlimDX), that supports Dx 10.1 and has beta support for Dx 11. They note "Although Direct3D 11 support is available, it's new and minimally tested. It would be a good idea to stick with the current Subversion source tree of SlimDX if you're working with it.". I don't know if that support includes compute shaders.



One does not simply walk into P/Invoke. It's a horrid wasteland, many a soul ventured there never to come back. Think twice about entering and have your trusty sword and debugger ready if you do.



You might also try C++/CLI; this .NET Frankenstein interfaces with native C/C++ fairly seamlessly (at the expense of producing code that is a mangled mix of native binary and managed IL) and you should be able to use Dx from there. CUDA not so much (it doesn't work with /MD). OpenCL might work.

#3
Posted 01/28/2010 06:54 PM   
Hi there,

have a look at SlimDX at [url="http://slimdx.org/"]http://slimdx.org/[/url]
It's a full DirectX 9, 10 and 11 wrapper in managed C++ which then can be used directly in C#.

And here is a link to a DirectCompute example in C#:
[url="http://recreationstudios.blogspot.com/2010/04/simple-compute-shader-example.html"]http://recreationstudios.blogspot.com/2010...er-example.html[/url]

I've been using SlimDX now for about 2 years and I have to say, these guys rock... very quick in updating SlimDX when a new version of the DirectX SDK comes out, quick on fixes and if you go to the DirectX forum on gamedev.net, they respond to questions and are very helpful... plus you get the full source in case you want to mess with it, though in the two years I've used it, I haven't found a need for that.

Happy Managed SuperComputing...
Hi there,



have a look at SlimDX at http://slimdx.org/

It's a full DirectX 9, 10 and 11 wrapper in managed C++ which then can be used directly in C#.



And here is a link to a DirectCompute example in C#:

http://recreationstudios.blogspot.com/2010...er-example.html



I've been using SlimDX now for about 2 years and I have to say, these guys rock... very quick in updating SlimDX when a new version of the DirectX SDK comes out, quick on fixes and if you go to the DirectX forum on gamedev.net, they respond to questions and are very helpful... plus you get the full source in case you want to mess with it, though in the two years I've used it, I haven't found a need for that.



Happy Managed SuperComputing...

#4
Posted 05/24/2010 08:28 PM   
Hi there,

have a look at SlimDX at [url="http://slimdx.org/"]http://slimdx.org/[/url]
It's a full DirectX 9, 10 and 11 wrapper in managed C++ which then can be used directly in C#.

And here is a link to a DirectCompute example in C#:
[url="http://recreationstudios.blogspot.com/2010/04/simple-compute-shader-example.html"]http://recreationstudios.blogspot.com/2010...er-example.html[/url]

I've been using SlimDX now for about 2 years and I have to say, these guys rock... very quick in updating SlimDX when a new version of the DirectX SDK comes out, quick on fixes and if you go to the DirectX forum on gamedev.net, they respond to questions and are very helpful... plus you get the full source in case you want to mess with it, though in the two years I've used it, I haven't found a need for that.

Happy Managed SuperComputing...
Hi there,



have a look at SlimDX at http://slimdx.org/

It's a full DirectX 9, 10 and 11 wrapper in managed C++ which then can be used directly in C#.



And here is a link to a DirectCompute example in C#:

http://recreationstudios.blogspot.com/2010...er-example.html



I've been using SlimDX now for about 2 years and I have to say, these guys rock... very quick in updating SlimDX when a new version of the DirectX SDK comes out, quick on fixes and if you go to the DirectX forum on gamedev.net, they respond to questions and are very helpful... plus you get the full source in case you want to mess with it, though in the two years I've used it, I haven't found a need for that.



Happy Managed SuperComputing...

#5
Posted 05/24/2010 08:28 PM   
Thanks for sharing the post with us.

[url="http://www.prodigyapex.com/"] Web Development Services [/url]
Thanks for sharing the post with us.



Web Development Services

#6
Posted 10/13/2010 07:42 AM   
Thanks for sharing the post with us.

[url="http://www.prodigyapex.com/"] Web Development Services [/url]
Thanks for sharing the post with us.



Web Development Services

#7
Posted 10/13/2010 07:42 AM   
You can also check out [url="http://www.tidepowerd.com"]GPU.NET[/url]. We're releasing the beta in a couple of weeks, and you'll be able to write pure C# and run it on your GPU (nothing else required, just compile and run!)
You can also check out GPU.NET. We're releasing the beta in a couple of weeks, and you'll be able to write pure C# and run it on your GPU (nothing else required, just compile and run!)

GPU.NET: Write your GPU code in 100% pure C#.

Learn more at tidepowerd.com, and download a free 30-day trial of GPU.NET. Follow @tidepowerd for release updates.



GPU.NET example projects

#8
Posted 10/13/2010 06:09 PM   
You can also check out [url="http://www.tidepowerd.com"]GPU.NET[/url]. We're releasing the beta in a couple of weeks, and you'll be able to write pure C# and run it on your GPU (nothing else required, just compile and run!)
You can also check out GPU.NET. We're releasing the beta in a couple of weeks, and you'll be able to write pure C# and run it on your GPU (nothing else required, just compile and run!)

GPU.NET: Write your GPU code in 100% pure C#.

Learn more at tidepowerd.com, and download a free 30-day trial of GPU.NET. Follow @tidepowerd for release updates.



GPU.NET example projects

#9
Posted 10/13/2010 06:09 PM   
[quote name='garyhibb' date='26 January 2010 - 06:04 PM' timestamp='1264525475' post='989221']
Is it possible to use direct compute with c# 2010 (and if so, where are samples, getting started tutorials, etc.)
[/quote]

You can also use [url="http://code.msdn.microsoft.com/WindowsAPICodePack"]Windows API Codepack[/url] but only after applying [url="http://code.msdn.microsoft.com/WindowsAPICodePack/WorkItem/View.aspx?WorkItemId=117"]fix1[/url] and [url="http://code.msdn.microsoft.com/WindowsAPICodePack/WorkItem/View.aspx?WorkItemId=116"]fix2[/url] I provided.
[quote name='garyhibb' date='26 January 2010 - 06:04 PM' timestamp='1264525475' post='989221']

Is it possible to use direct compute with c# 2010 (and if so, where are samples, getting started tutorials, etc.)





You can also use Windows API Codepack but only after applying fix1 and fix2 I provided.

Miha Markic

#10
Posted 11/18/2010 09:54 PM   
[quote name='garyhibb' date='26 January 2010 - 06:04 PM' timestamp='1264525475' post='989221']
Is it possible to use direct compute with c# 2010 (and if so, where are samples, getting started tutorials, etc.)
[/quote]

You can also use [url="http://code.msdn.microsoft.com/WindowsAPICodePack"]Windows API Codepack[/url] but only after applying [url="http://code.msdn.microsoft.com/WindowsAPICodePack/WorkItem/View.aspx?WorkItemId=117"]fix1[/url] and [url="http://code.msdn.microsoft.com/WindowsAPICodePack/WorkItem/View.aspx?WorkItemId=116"]fix2[/url] I provided.
[quote name='garyhibb' date='26 January 2010 - 06:04 PM' timestamp='1264525475' post='989221']

Is it possible to use direct compute with c# 2010 (and if so, where are samples, getting started tutorials, etc.)





You can also use Windows API Codepack but only after applying fix1 and fix2 I provided.

Miha Markic

#11
Posted 11/18/2010 09:54 PM   
[quote name='garyhibb' date='27 January 2010 - 01:04 AM' timestamp='1264525475' post='989221']
Is it possible to use direct compute with c# 2010 (and if so, where are samples, getting started tutorials, etc.)
[/quote]

SlimDX is probably the answer to your question.

If you wanted something more cross platform you might want to look at OpenTK (OpenGL wrapper) and Cloo (OpenCl)

This site has many examples this being one of the more advanced
http://www.cmsoft.com.br/index.php?option=com_content&view=category&layout=blog&id=99&Itemid=150

I'm guessing you could use Cloo with OpenCL's DirectX integration but then you would need something like SlimDX anyway and at that stage you may as well go DirectCompute as well.
[quote name='garyhibb' date='27 January 2010 - 01:04 AM' timestamp='1264525475' post='989221']

Is it possible to use direct compute with c# 2010 (and if so, where are samples, getting started tutorials, etc.)





SlimDX is probably the answer to your question.



If you wanted something more cross platform you might want to look at OpenTK (OpenGL wrapper) and Cloo (OpenCl)



This site has many examples this being one of the more advanced

http://www.cmsoft.com.br/index.php?option=com_content&view=category&layout=blog&id=99&Itemid=150



I'm guessing you could use Cloo with OpenCL's DirectX integration but then you would need something like SlimDX anyway and at that stage you may as well go DirectCompute as well.

#12
Posted 03/28/2011 02:46 AM   
Hi _Big_Mac_,<br /> <br /> <br /> <br /> Great information thanks for sharing........<br /> <br />
Hi _Big_Mac_,<br />
<br />
<br />
<br />
Great information thanks for sharing........<br />
<br />

#13
Posted 06/13/2011 07:43 AM   
Miha Markic you are right. I am using c# in the same format you have discussed here. This works.

____________________________________________________________________________________________________
[url="http://www.georgia-drivingrecord.com"]Georgia Driving Record[/url] |[url="http://www.onlinetrafficschoolus.com"]Online Traffic School[/url] |[url="http://www.drivereducation-online.com"]Drivers Ed Online[/url]">
Miha Markic you are right. I am using c# in the same format you have discussed here. This works.



____________________________________________________________________________________________________

Georgia Driving Record |Online Traffic School |Drivers Ed Online">

#14
Posted 08/01/2011 11:48 AM   
Hey Big_Mac thanks for sharing a work round for time being... before we shift into Direct3D


________________________________________________________________________________________________________________________________________________________________
[b][url="http://www.georgia-drivers-education.us/joshua-law.html"]Joshua's Law[/url] | [url="http://www.georgia-drivers-education.us/dds-practice-tests.html"]DDS Practice Test[/url] [/b]
Hey Big_Mac thanks for sharing a work round for time being... before we shift into Direct3D





________________________________________________________________________________________________________________________________________________________________

Joshua's Law | DDS Practice Test

#15
Posted 08/18/2011 06:51 AM   
Scroll To Top