Technical data

Cray Standard C/C++ Reference Manual
extern float a[], b[], c;
extern void crunch( float *x, float *y, float z);
void
f(int n)
{
int i;
#pragma _CRI cncall
for (i = 0; i < n; ++i) {
crunch( &a[i], &b[i], c );
}
}
In example 1, a[i] and b[i] denote unique storage locations for each iteration,
so crunch can read and write *x and *y. Because c is passed by value, crunch
can read and write z.
Example 2 illustrates some of the subtle distinctions involved:
extern void tskvalue(int *);
void
s(int ke)
{
int itask, k, x;
/* The following loop may not task because */
/* the compiler can not be certain that */
/* tskvalue defines itask on each iteration. */
#pragma _CRI cncall
for (k = 0; k < ke; ++k) {
tskvalue(&itask); /* itask not necessarily defined. */
itask = itask + 1; /* potential recurrence in use of itask.*/
}
/* The following loop tasks because in each iteration */
/* itask is necessarily defined before it is used. */
#pragma _CRI cncall
for (k = 0; k < ke; ++k) {
itask = 0; /* itask defined before used. */
tskvalue(&itask);
itask = itask + 1;
68 S217936