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.

Built-in Variables for Device Code<br />

• Predefined variables in device subroutines<br />

– Grid and block dimensions - gridDim, blockDim<br />

– Block and thread indices - blockIdx, threadIdx<br />

– Of type dim3<br />

type (dim3)<br />

integer (kind=4) :: x, y, z<br />

end type<br />

– blockIdx and threadIdx fields have unit offset<br />

1

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

Saved successfully!

Ooh no, something went wrong!