Accelerator Data Region Directive. STMicroelectronics PGI
Tangazo
Tangazo
Chapter 18. PGI Accelerator Compilers Reference
• Accelerator regions may not be nested.
• A program may not branch into or out of an accelerator region.
• A program must not depend on the order of evaluation of the clauses, or on any side effects of the evaluations.
• At most one if
clause may appear. In Fortran, the condition must evaluate to a scalar logical value; in C, the condition must evaluate to a scalar integer value.
• A variable may appear in only one of the local
, copy
, copyin
or copyout
lists.
Accelerator Data Region Directive
This directive defines data, typically arrays, that should be allocated in the device memory for the duration of the data region. Further, it defines whether data should be copied from the host to the device memory upon region entry, and copied from the device to host memory upon region exit.
Syntax
In C, the syntax of an accelerator region directive is:
#pragma acc data region [clause [, clause]…] new-line
structured block
In Fortran, the syntax is:
!$acc data region [clause [, clause]…]
structured block
!$acc end data region
:
copy( list )
copyin( list )
copyout( list )
local( list )
mirror( list )
update device( list )
update host( list )
Description
Data is allocated in the device memory and copied from the host memory to the device, or copied back, as required.
The
list
argument to each data clause is a comma-separated collection of variable names, array names, or subarray specifications. In all cases, the compiler allocates and manages a copy of the variable or array in device memory, creating a visible device copy of that variable or array.
In C, a subarray is an array name followed by a range specification in brackets, such as this:
arr[2:high][low:100]
In Fortran, a subarray is an array name followed by a comma-separated list of range specifications in parentheses, such as this:
319
Pakua
Tangazo