{"id":4702,"date":"2011-07-29T11:38:12","date_gmt":"2011-07-29T10:38:12","guid":{"rendered":"http:\/\/www.itwriting.com\/blog\/4702-gpu-programming-for-net-tidepowerds-gpu-net-gets-some-improvements-more-needed.html"},"modified":"2011-07-29T11:38:12","modified_gmt":"2011-07-29T10:38:12","slug":"gpu-programming-for-net-tidepowerds-gpu-net-gets-some-improvements-more-needed","status":"publish","type":"post","link":"https:\/\/www.itwriting.com\/blog\/4702-gpu-programming-for-net-tidepowerds-gpu-net-gets-some-improvements-more-needed.html","title":{"rendered":"GPU Programming for .NET: Tidepowerd\u2019s GPU.NET gets some improvements, more needed"},"content":{"rendered":"<p>When I attended the 2010 GPU programming conference hosted by NVIDIA I encounted <a href=\"http:\/\/www.tidepowerd.com\/\" target=\"_blank\">Tidepowerd<\/a>, which has a .NET library called GPU.NET for GPU programming.<\/p>\n<p>GPU programming enables amazing performance improvements for certain types of code. Most GPU programming is done in C\/C++, but Typepowerd lets you run code in .NET, simply marking any methods you want to run on the GPU with a [kernel] attribute:<\/p>\n<blockquote>\n<pre><p>[Kernel]\n<\/p><p>private static void AddGpu(float[] a, float[] b, float[] c)<\/p><p>{<\/p><p>\/\/ Get the thread id and total number of threads<\/p><p>int ThreadId = BlockDimension.X * BlockIndex.X + ThreadIndex.X;<\/p><p>int TotalThreads = BlockDimension.X * GridDimension.X;<\/p><p>for (int ElementIndex = ThreadId; ElementIndex &lt; a.Length; ElementIndex += TotalThreads)<\/p><p>{<\/p><p>c[ElementIndex] = a[ElementIndex] + b[ElementIndex];<\/p><p>}<\/p><p>}<\/p><\/pre>\n<\/blockquote>\n<p>GPU.NET is now at version 2.0 and includes Visual Studio Error List and IntelliSense support. This is useful, since some C# code will not run on the GPU. Strings, for example, are not supported. Take a look at <a href=\"http:\/\/help.tidepowerd.com\/kb\/getting-started-with-gpunet\/currently-supported-hardware-languages-and-their-restrictions\" target=\"_blank\">this article<\/a> which lists .NET OpCodes that do not work in GPU.NET. <\/p>\n<p>GPU.NET requires an NVIDIA GPU with CUDA support and a CUDA 3.0 driver. It can run on Mac and Linux using Mono, the open source implementation of .NET. In principle, GPU.NET could also work with AMD GPUs or others via a vendor-specific runtime:<\/p>\n<p><a href=\"http:\/\/www.itwriting.com\/blog\/wp-content\/uploads\/2011\/07\/image33.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px\" title=\"image\" border=\"0\" alt=\"image\" src=\"http:\/\/www.itwriting.com\/blog\/wp-content\/uploads\/2011\/07\/image_thumb32.png\" width=\"340\" height=\"274\" \/><\/a><\/p>\n<p>but the latest <a href=\"http:\/\/help.tidepowerd.com\/kb\/general\/faq-frequently-asked-questions\" target=\"_blank\">FAQ<\/a> says:<\/p>\n<blockquote>\n<p>Support for AMD devices is currently under development, and support for other hardware architectures will follow shortly.<\/p>\n<\/blockquote>\n<p>Another limitation is support for multiple GPUs. If you want to do serious supercomputing relatively cheaply, stuffing a PC with a bunch of <a href=\"http:\/\/www.nvidia.com\/object\/personal-supercomputing.html\" target=\"_blank\">Tesla<\/a> GPUs is a great way to do it, but currently GPU.NET only used one GPU per active thread as far as I can tell from this note:<\/p>\n<blockquote>\n<p>The GPU.NET runtime includes a work-scheduling system which can distribute device method (\u201ckernel\u201d) calls to multiple GPUs in the system; at this time, this only works for applications which call device-based methods from multiple host threads using multiple CPU cores. In a future release, GPU.NET will be able to use multiple GPUs to execute a single method call.<\/p>\n<\/blockquote>\n<p>I doubt that GPU.NET or other .NET libraries will ever compete with C\/C++ for performance, but ease of use and productivity count for a lot too. Potentially GPU.NET could bring GPU programming to the broad range of .NET developers.<\/p>\n<p>It is also worth checking out hoopoe\u2019s <a href=\"http:\/\/www.hoopoe-cloud.com\/Solutions\/CUDA.NET\/Default.aspx\" target=\"_blank\">CUDA.NET<\/a> and <a href=\"http:\/\/www.hoopoe-cloud.com\/Solutions\/OpenCL.NET\/Default.aspx\" target=\"_blank\">OpenCL.NET<\/a> which are free libraries. I have not done a detailed comparison but would be interested to hear from others who have.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When I attended the 2010 GPU programming conference hosted by NVIDIA I encounted Tidepowerd, which has a .NET library called GPU.NET for GPU programming. GPU programming enables amazing performance improvements for certain types of code. Most GPU programming is done in C\/C++, but Typepowerd lets you run code in .NET, simply marking any methods you &hellip; <a href=\"https:\/\/www.itwriting.com\/blog\/4702-gpu-programming-for-net-tidepowerds-gpu-net-gets-some-improvements-more-needed.html\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">GPU Programming for .NET: Tidepowerd\u2019s GPU.NET gets some improvements, more needed<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,55,57,62,67,80],"tags":[436,438,654,849,911],"class_list":["post-4702","post","type-post","status-publish","format-standard","hentry","category-net","category-microsoft","category-mono","category-open-source","category-professional","category-software-development","tag-gpu-computing","tag-gpu-net","tag-nvidia","tag-software-development","tag-tidepowrd"],"_links":{"self":[{"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/posts\/4702","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/comments?post=4702"}],"version-history":[{"count":0,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/posts\/4702\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/media?parent=4702"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/categories?post=4702"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/tags?post=4702"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}