नोट
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप साइन इन करने या निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
इस पृष्ठ तक पहुंच के लिए प्राधिकरण की आवश्यकता होती है। आप निर्देशिकाएँ बदलने का प्रयास कर सकते हैं।
'var' : variable in 'private' clause cannot be a reduction variable in enclosing context
Remarks
Variables that appear in the reduction clause of a parallel directive cannot be specified in a private clause on a work-sharing directive that binds to the parallel construct.
Example
The following example generates C3038:
// C3038.cpp
// compile with: /openmp /c
int g_i, g_i2;
int main() {
int i;
#pragma omp parallel reduction(+: g_i)
{
#pragma omp for private(g_i) // C3038
// try the following line instead
// #pragma omp for private(g_i2)
for (i = 0; i < 10; ++i)
g_i += i;
}
}