Several practical issues for CUDA

来源:互联网 发布:模式识别算法应用 编辑:程序博客网 时间:2024/06/03 15:05

GPU rocks, indeed. But its application is kinda like steering a wild horse. Not being familiar with it may make you crazy.

 

1. Take care of the computing abilities among different versions of CUDA

The differences among different versions of CUDA are huge, because CUDA is growthing rapidly. Before starting your develop, you have to refer to the corresponding GPU manual. – How many SM it has? Global memory lock supported? etc.

 

2. A good parallel design is essential

Never write your CUDA kernel in a ‘scattering’ way (one read & many writes), which will bring you quite a lot of bank conflict. Always write the kernel in a ‘gathering’ way(many reads & one write).

 

3. Seperate CPU code with GPU code

 

Can u believe that nvcc in emulation mode will not separate CPU/GPU code, while non-emulation mode nvcc does ? Take care of it dude. Also, it seems that MACRO is the only way for param sharing between CPU code and GPU code. Also, the only OO component you can use is ‘struct’.

 

In my current work, GPU helps my rendering rate be accelerated nearly 100 times faster !

原创粉丝点击