OpenACC code with pinned memory

Good time of day.
I would like to ask you if it is possible to use pinned memory with OpenACC code? When I try to do this, I get next error:

PGF90-S-0034-Syntax error at or near pinned (matmul.f90: 6)
0 inform, 0 warnings, 1 severes, 0 fatal for main

I compile like:

pgfortran -O3 -acc -fast -ta=nvidia -Minfo=accel matmul.f90 -o matmul

My code looks like:

real (8), dimension(:,:), allocatable, pinned :: a, b, c

allocate( a(n,m) )
allocate( b(n,m) )
allocate( c(n,m) )
call acc_init( acc_device_nvidia )

!$acc data copyin(a,b) copyout©

!$acc kernels loop

!$acc end kernels
!$acc end data

Thank you in advance,


I think “pinned” is only part of CUDA Fortran, so you might have to add “-Mcuda” to your compile string for the compiler to recognize it.


Thank you, Matt.
Yes, it works with -Mcuda
I am wondering if there are any possible conflict situations on allocating pinned memory at the OpenACC code?

Cuda Fortran and OpenACC are interoperable, so no they would not be in conflict.

  • Mat

Thank you for an explanations!