kernel. STMicroelectronics PGI
Διαφήμιση
Διαφήμιση
Chapter 18. PGI Accelerator Compilers Reference
Note
It is an error to use the independent
clause if any iteration writes to a variable or array element that any other iterations also writes or reads.
kernel
The kernel
clause tells the compiler that the body of this loop is to be the body of the computational kernel.
Any loops contained within the kernel loop are executed sequentially on the accelerator.
kernel clause restrictions
The kernel
clause has this restriction:
• Loop mapping directives must not appear on any loop contained within the kernel loop.
parallel [(width)]
The parallel
clause tells the compiler to execute this loop in parallel mode on the accelerator. There may be a target-specific limit on the number of iterations in a parallel loop or on the number of parallel loops allowed in a given kernel. If there is a limit:
• If there is no
width
argument, or the value of the
width
argument is greater than the limit, the compiler enforces the limit.
• If there is a
width
argument or a limit on the number of iterations in a parallel loop, then only that many iterations can run in parallel at a time.
private (list)
You use the private
clause to declare that the variables, arrays, or subarrays in the
list
argument need to be allocated in the accelerator memory with one copy for each iteration of the loop.
Any value of the variable or array used in the loop must have been computed and assigned in that iteration of the loop, and the values computed and assigned in any iteration are not needed after completion of the loop.
Using an array name without bounds tells the compiler to analyze the references to the array to determine what bounds to use. If the lower or upper bounds are missing, the declared or allocated bounds, if known, are used.
private clause restrictions
The private
clause has these restrictions:
• A variable, array or subarray may only appear once in any private
clause for a loop.
• Only one subarray for an array may appear in any private
clause for a loop.
• If a subarray appears in a private
clause, then the compiler only needs to allocate memory to hold that subarray in the accelerator memory.
• The compiler may pad dimensions of allocated arrays or subarrays to improve memory alignment and program performance.
329
Λήψη
Διαφήμιση