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; |