mirror of
https://github.com/OpenMP/Examples.git
synced 2025-04-07 23:22:11 +01:00
16 lines
266 B
C
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;
|
|
}
|