how to make an array private with the private clause?

I tried to make an array private using the private clause but always got compilation error. Does the private clause work with arrays? The OpenACC standard doesn’t say it only works for scalars.



No, it works with arrays. What’s the error? What type are the arrays and how are your privatizing them?

  • Mat


The error message is very generic:
PGF90-S-0533- (tsolve_sweep_y.f90: 17)
0 inform, 0 warnings, 1 severes, 0 fatal for tsolve_sweep_y

line 17 is OpenACC directives look as follow:

!$acc kernels present(atp, ate, ats, atn, atw, bt, t) private(a, b)

a is a two dimensional array and b is a one dimensional array. Both are double precision.

The compiler I used is 12.8. My code cannot work with the newer compiler, a problem I haven’t investigate yet.



Hi Ping,

The “private” clause can only be applied to a “loop” or “parallel” directive. Note that the syntax error has been improved in the 2013 compilers.

PGF90-S-0533-Clause ‘PRIVATE’ not allowed in ‘ACC KERNELS’ directive

Hope this helps,

Yes. You are right. But why the kernels doesn’t allow private in the standard.


A kernel region could possibly be split into multiple device kernels, while a parallel region and the loop directive, encompass only a single device kernel. A private clause is limited in scope to a single device kernel since the loop schedule can change, and thus the number of threads.

  • Mat