Use C # for GPU Programming

Source: Internet
Author: User

Use C # for GPU Programming

We have been using the nvidia cuda platform to write General programs to take advantage of nvidia gpu's computing performance. Although CUDA supports different programming languages, writing high-performance Code usually requires C or C ++. Many developers have to give up using their preferred programming language to write GPU-oriented code. Until recently, C # developers have finally been able to get rid of this dilemma.

Hybridizer, a new compilation tool launched by Altimesh, solves this problem by providing a new compilation method for C # developers. It compiles the developer's source code into a GPU-oriented binary code that can run on the CUDA platform. Hybridizer is divided into two versions to meet different needs and budgets. Hybridizer Essentials is an extension of Visual Studio and is free to all users. It can generate binary code running on the CUDA platform. Hybridizer Software Suite (HSE) is an authorized Software that provides compilation functions for CUDA and other platforms (including AVX, AVX2, and AX512. The software suite can generate binary code, but you can also choose to generate CUDA source code so that users can review the content being compiled.

With NVIDIA's Nsight Visual Studio Edition, any Hybridizer version provides developers with a way to write and debug C # code in Visual Studio, And the generated code is executed on nvidia gpu. HSE runs in Microsoft Intermediate Language (MSIL), so it can be integrated with existing projects, even without the source code of these projects. This also provides indirect support for the. NET platform languages F # and VB. NET on the same platform.

Since one of the goals of Writing C/C ++ code for the CUDA platform is to maximize the performance, it is worth comparing the performance of the C # Code Compiled by Hybridizer. According to Altimesh, the binary code compiled by C # achieves 83% performance of the handwritten CUDA-oriented C ++ code. Based on the actual code, you can further optimize the C # code to achieve the same performance as C ++.

Hybridizer provides C # developers curious about CUDA and GPU programming with a way to explore these technologies without having to give up using their preferred technologies. The sample code can be obtained on GitHub, and Hybridizer essenessenextension can be obtained on Visual Studio Marketplace.

Using C # to Target GPUs

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.