OpenMP-Examples/sources/Example_ploop.1c.c
2015-01-13 11:38:24 -08:00

16 lines
266 B
C

/*
* @@name: ploop.1c
* @@type: C
* @@compilable: yes
* @@linkable: no
* @@expect: success
*/
void simple(int n, float *a, float *b)
{
int i;
#pragma omp parallel for
for (i=1; i<n; i++) /* i is private by default */
b[i] = (a[i] + a[i-1]) / 2.0;
}