|
|
От: |
remark
|
http://www.1024cores.net/ |
| Дата: | 10.09.10 09:44 | ||
| Оценка: | |||
The restrictions to the reduction clause are as follows:
The type of the variables in the reduction clause must be valid for the reduction operator except that pointer types and reference types are never permitted.
A variable that is specified in the reduction clause must not be const-qualified.
Variables that are private within a parallel region or that appear in the reduction clause of a parallel directive cannot be specified in a reduction clause on a work-sharing directive that binds to the parallel construct.
#pragma omp parallel private(y) { /* ERROR - private variable y cannot be specified in a reduction clause */ #pragma omp for reduction(+: y) for (i=0; i<n; i++) y += b[i]; } /* ERROR - variable x cannot be specified in both a shared and a reduction clause */ #pragma omp parallel for shared(x) reduction(+: x)