A preliminary study on C # GPU

Source: Internet
Author: User
A preliminary study on C # GPU general computing


First of all thanks for unauthorized reprint.


GPU's parallel computing capacity is higher than the CPU, so recently there are many projects using the GPU appear in our vision, in InfoQ see this article on Accelerator-v2, it is Microsoft Research project, need to register to download, feel as I touch GPU general operations The first step is not bad, so go to download the back.

In the installation package, contains a few examples of programs, such as the famous Life game, however, the life game, compared to just touch the GPU operation of me, or slightly more complicated. So simplify, just do some simple calculations, found that dx9target.toarray if the return parameter is an array of int, will burst the "unsupported operation" of the exception, think about it, the graphics card is really proficient in floating-point operations.

Originally, I thought that the GPU operation was a feature of DirectX 11, but accelerator supported DirectX 9, and wanted DirectX 11 to support more computational power and simpler ways.

In order to compare the CPU and GPU speed, also wrote a. NET 4 parallel operation of the program, because Dx9target does not support int, so the array here is also float, as follows:

01 Private Const int GridSize = 1024;
02 Private float[] _map;
03
04 Public Form1 ()
05 {
06

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.