19.11.2014 Views

Tutorial: Introduction to CUDA Fortran | GTC 2013

Tutorial: Introduction to CUDA Fortran | GTC 2013

Tutorial: Introduction to CUDA Fortran | GTC 2013

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Mapping Arrays <strong>to</strong> Thread Blocks<br />

• call inc(a_d, b)<br />

blockDim%x = 4<br />

blockIdx%x<br />

1<br />

2<br />

3<br />

threadIdx%x<br />

1 2 3 4<br />

1 2 3 4<br />

1 2 3 4<br />

(blockIdx%x-1)*blockDim%x<br />

+ threadIdx%x<br />

1 2 3 4<br />

5 6 7 8<br />

9 10 11 12

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

Saved successfully!

Ooh no, something went wrong!