GAP Message (Diagnostic ID 30526)

Message

To parallelize the loop at line %d, annotate the routine %s with %s.

Advice

If the loop contains a call to a function, the compiler cannot parallelize the loop without more information about the function being called.

However, if the function being called in the loop is a const function or a concurrency-safe function, then the call does not inhibit parallelization of the loop.

Example

Consider the following:

#define N 10000
double A[N], B[N];
int bar(int);
void foo(){
  int i;
  for (i=0;i<N;i++){
    A[i] = B[i] * bar(i);
  }
}

In this case, the compiler does not parallelize the loop because it is not safe to do so without further information about routine bar, which is being called.

If you determine it is safe to do so, you can modify the program code as follows:

#define N 10000
double A[N], B[N];
__declspec(const) int bar(int);
void foo(){
  int i;
  for (i=0;i<N;i++){
    A[i] = B[i] * bar(i);
  }
}

The following is another way the code can be modified if it is safe to do so:

#define N 10000
double A[N], B[N];
__declspec(concurrency_safe(profitable)) int bar(int);
void foo(){
  int i;
  for (i=0;i<N;i++){
    A[i] = B[i] * bar(i);
  }
}

Verify

Make sure the routine satisfies the semantics of this annotation. A weaker annotation that can achieve a similar effect is __declspec(concurrency_safe(profitable).

See Also


Submit feedback on this help topic

Copyright © 1996-2011, Intel Corporation. All rights reserved.