Technical data
#pragma Directives [3]
directive to take effect. Threshold testing for the loop specified by using the
prefertask directive is suppressed. The format of the prefertask directive is
as follows:
#pragma _CRI prefertask
The following example illustrates the use of the prefertask directive:
for (i = 0; i < n; i++)
{
#pragma _CRI prefertask
for (j = 0; j < m; j++)
e[j][i] = f[j][i] + g[j][i];
}
In the preceding example, both loops can be tasked, but the directive directs the
compiler to task the inner for loop. Without the directive and without any
knowledge of n and m, the compiler tasks the outer for loop. Using the directive,
the loops are interchanged (to increase parallel granularity) and the resulting
outer for loop (involving j) is tasked. See also the prefervector directive in
Section 3.7.5, page 60.
3.8.13 Arguments to Tasking Directives
The tasking directive arguments are categorized as context arguments, work
distribution arguments, or miscellaneous arguments. Arguments can appear in
any order in the directive.
3.8.13.1 Tasking Context
For user-directed tasking, each variable referenced in the parallel region must be
assigned a tasking context. Tasking context is an attribute that determines how the
different processors access a variable in a parallel region. The tasking context
(also called context) of a variable can be private, shared,orvalue. The
private, shared, and value arguments are called tasking context arguments.
It is an error for a variable to be listed more than once in the lists for the tasking
context arguments.
Any variables declared inside a parallel region and any variables declared in a
function called from inside a parallel region use the default rule (which follows)
S–2179–36 79










