Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
'var' : variable in 'reduction' clause/directive cannot have reference type
Remarks
You can only pass value parameters to certain clauses, such as the reduction clause.
Example
The following example generates C3030:
// C3030.cpp
// compile with: /openmp /link vcomps.lib
#include "omp.h"
void test(int &r) {
   #pragma omp parallel reduction(+ : r)   // C3030
      ;
}
void test2(int r) {
   #pragma omp parallel reduction(+ : r)   // OK
      ;
}
int main(int argc, char** argv) {
   int& r = *((int*)argv);
   int s = *((int*)argv);
   #pragma omp parallel reduction(+ : r)   // C3030
      ;
   #pragma omp parallel reduction(+ : s)   // OK
      ;
}