Compiler Error C3040
'var' : type of variable in 'reduction' clause is incompatible with reduction operator 'operator'
A variable in a reduction clause cannot be used with the reduction operator.
The following sample generates C3040:
// C3040.cpp
// compile with: /openmp /c
#include "omp.h"
double d;
int main() {
#pragma omp parallel reduction(&:d) // C3040
;
#pragma omp parallel reduction(-:d) // OK
;
}
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for