User`s guide
Compiler Directives and Assertions [C]
#pragma mta assert parallel
This directive can appear before a loop construct and asserts that the
separate iterations of the loop may execute concurrently without
synchronization. It does not guarantee that the compiler parallelizes
the loop, but it is a strong suggestion to the compiler. This directive
affects the next loop only. The directive is ignored if the -nopar
flag is used on the command line.
#pragma mta assert local variable-list
This directive can appear inside a loop or inside the body of a
function, or at the top of the loop or function. For a loop, it asserts
that at the beginning of each iteration, the compiler can treat the
listed variables as undefined, and that their values are not referenced
after the completion of that iteration. For a function, it asserts that the
variables are undefined on entry to the function, and that their values
are not referenced after exiting the function. The behavior of this
directive is the same regardless of whether the loop or function to
which it is attached executes in a parallel or serial context.
void assert_local_example(double B[], const int N)
{
double A[2];
for (int i = 0; i < N; i++) {
#pragma mta assert local A
A[0] = i;
A[1] = 2*i;
B[i] = A[0]*A[1];
}
}
In the previous example, the directive asserts that A is used as a
scratch array in the loop. This directive must be inside the loop in
order to affect the loop.
S–2479–20 127