Feature request: "calloc" version of "acc ent


I have a lot of arrays that are initialized to all 0s but need to be on the device.

I currently am using an “acc enter data copyin” but since they are all zeros, I would really just want a “calloc” version of “enter data create”.

I know I could just create the array and initialize it on the device but I do not want the kernel overhead.

Is there a way to do this now? If not, it is a feature request.

Hi sumseq,

In the upcoming 17.1 release, we’ve added a new option “-ta=tesla:zeroinit” which will initialize device data to zero. We also adding an environment variable “PGI_ACC_DATA_INIT” which can be set to a one byte value where this value is used to initialize the device data.

Will this meet your needs?



That sounds perfect, except that I am concerned that it is a compile flag and not part of the OpenACC standard in the code. This could lead to issues if this is assumed to be the case in the code but someone compiles it forgetting the flag…

I would much prefer something like:

!$acc enter data create init0 (array)

or maybe

!$acc enter data create_init0 (array)

or even…

!$acc enter data create (array) init (#)

where # is some scalar.

Could you pass this along to the OpenACC standard folks?

Sure, though feel free to send the request directly to them, or post the request on the OpenACC Users mailing list.


  • Mat