Intel® C++ Compiler 16.0 User and Reference Guide
Add "%s" to the declaration of routine "%s" in order to parallelize the loop at line %d. Adding "%s" achieves a similar effect.
Confirm that the routine specified is indeed a const function or a concurrency-safe function before following the advice to add the annotation.
If the routine is not one of these kinds of functions, try to inline it with #pragma forceinline recursive. This action may or may not be beneficial.
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 add the pragma as follows:
#define N 10000 double A[N], B[N]; void foo(){ int i; #pragma forceinline recursive for (i=0;i<N;i++){ A[i] = B[i] * bar(i); } }
Confirm that the routine satisfies the semantics of this declaration. Another way to help the loop being parallelized is to inline the routine with the forceinline recursive pragma, but this method does not guarantee parallelization.