Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

A.7 Using the reduction Clause

The following example demonstrates the reduction clause (Section on page 28):

#pragma omp parallel for private(i) shared(x, y, n) \
                         reduction(+: a, b)
    for (i=0; i<n; i++) {
        a = a + x[i];
        b = b + y[i];
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft. All rights reserved.