#pragma acc declare link(data_list)

Could You, please, explain to me in simple words what this directive of memory allocation means (i read PGI user guide, but didn’t understand) and how it works?

Hi Andrey,

“declare link” is used with global static host variables that have dynamic lifetime on the device. Like other “declare” clauses, a global device reference to the data is created upon load which can then be accessed from compute regions or from device routines. However, the actual device data creation is deferred until the variable is included in a data region and thus can be dynamically created and destroyed on the device.

Note that “declare link” is one of the few things that PGI has not implemented from the OpenACC 2.5 standard. Currently, PGI treats “declare link” the same as “declare create” where the device copy of the variable has a static lifetime.

-Mat