P. 1
CUDA FORTRAN

CUDA FORTRAN

|Views: 4,034|Likes:
Published by Mark Munthe

More info:

Published by: Mark Munthe on May 18, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

06/12/2013

pdf

text

original

Allocatable arrays with the pinned attribute are dynamically allocated using the Allocate statement. The
compiler will generate code to allocate the array in host page-locked memory, if available. If no such memory
space is available, or if it is exhausted, the compiler allocates the array in normal paged host memory.
Otherwise, pinned allocatable arrays work and act like any other allocatable array on the host.

real, allocatable, pinned :: p(:)
allocate(p(5000),stat=istat)

if(allocated(p)) deallocate(p)

Chapter 3. Reference

19

To determine whether or not the allocation from page-locked memory was successful, an additional PINNED
keyword is added to the allocate statement. It returns a logical success value.

logical plog
allocate(p(5000), stat=istat, pinned=plog)
if (.not. plog) then
. . .

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->