06.08.2012 Views

Getting Started with CUDA

Getting Started with CUDA

Getting Started with CUDA

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Unique Thread IDs<br />

Built-in variables are used to determine unique<br />

thread IDs<br />

Map from local thread ID (threadIdx) to a global ID which<br />

can be used as array indices<br />

blockIdx.x<br />

blockDim.x = 5<br />

threadIdx.x<br />

Grid<br />

blockIdx.x*blockDim.x<br />

+ threadIdx.x<br />

0<br />

0 1 2 3 4<br />

1<br />

0 1 2 3 4<br />

© 2008 NVIDIA Corporation.<br />

2<br />

0 1 2 3 4<br />

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!