Declaring pinned memory

As I get used to CUDA Fortran, I have a simple question about syntax. Does pinned memory have to be allocatable? That is are:

real, pinned :: ta(m,np)

and

real, allocatable, pinned :: ta(:,:)
allocate(ta(m,np))

equivalent? Or do you need the explicit allocate to use pinned memory? (Note: I understand the latter is probably better, no matter what, since you can use the PINNED keyword with it.)

Hi Matt,

Pinned is only effective with allocatables. It’s ignored otherwise.

Note that I put in a request last week to have a warning emitted when using the pinned attribute on a non-allocatable.

  • Mat