Tutorial: Introduction to CUDA Fortran | GTC 2013
Tutorial: Introduction to CUDA Fortran | GTC 2013
Tutorial: Introduction to CUDA Fortran | GTC 2013
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Data Transfers<br />
program copyData<br />
use cudafor<br />
implicit none<br />
integer, parameter :: n = 256<br />
real :: a(n), b(n)<br />
real, device :: a_d(n), b_d(n)<br />
a = 1.0<br />
a_d = a<br />
b_d = a_d<br />
b = b_d<br />
Host<br />
CPU<br />
DRAM<br />
a<br />
b<br />
PCIe<br />
Device<br />
GPU<br />
DRAM<br />
a_d<br />
b_d<br />
if (all(a == b)) &<br />
write(*,*) 'Test Passed'<br />
end program copyData