Tutorial: Introduction to CUDA Fortran | GTC 2013
Tutorial: Introduction to CUDA Fortran | GTC 2013
Tutorial: Introduction to CUDA Fortran | GTC 2013
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Strided Data Access<br />
• Use array increment kernel with variable stride<br />
attributes(global) subroutine stride(a, s)<br />
real :: a(*)<br />
integer,! value :: s<br />
integer :: i<br />
i = (blockDim%x*(blockIdx%x-1)+threadIdx%x) * s<br />
a(i) = a(i)+1 !<br />
end subroutine stride<br />
Array a() allocated with padding <strong>to</strong> avoid out-of-bounds accesses