CUDA Quick Guide

1 downloads 251 Views 803KB Size Report
Apply custom build rule to project. 4.Additional Include Directories : $(CUDA_INC_PATH). 5.Additional Library Directorie
CUDA Quick Guide

Outline ● SDK installation ● Coding with visual c++ ● Basic concept ● Memory ● Kernal ● Special Behavior ● Visual Profiler ● FYR ● Q ^= A

SDK Installation 1. http://www.nvidia.com/object/cuda_get.html ○ v2.3 CUDA driver ○ v2.3 CUDA toolkit (v3.2 in 2011/04) ○ v2.3 CUDA SDK

Coding with VC 1. Copy Cuda.Rules : ○ From : SDK / C / common / ○ To : MSVS / VC / VCProjectDefaults / 2. Syntax high light 3. Apply custom build rule to project 4. Additional Include Directories : $(CUDA_INC_PATH) 5. Additional Library Directories : $(CUDA_LIB_PATH) 6. Additional Dependency : cudart.lib 7. Distribute cudart.dll (not included in graphic driver)

Syntax high light

Check SDK\C\doc\syntax_highlighting\ if you want more.

Custom Build Rule - 1

Custom Build Rule - 2

Custom Build Rule - 3

Basic Concept

Basic Concept - Thread Block 1. Index of thread in a block is 3 d (x, y, z) 2. Shared memory is shared between threads in one block ! 3. On current GPUs, a thread block may contain up to 512 threads. ○ x