Quantcast
Channel: Intel® C++ Compiler
Viewing all articles
Browse latest Browse all 1616

GAP Message (Diagnostic ID 30526)

$
0
0

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);
  } 
}

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

#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);
  } 
}

Example

Consider the following:

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).

Inglés

Viewing all articles
Browse latest Browse all 1616

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>