2022-11-04 09:35:42 -07:00

26 lines
525 B
C

/*
* @@name: nowait.2
* @@type: C
* @@operation: compile
* @@expect: success
* @@version: pre_omp_3.0
*/
#include <math.h>
void nowait_example2(int n, float *a, float *b, float *c, float *y, float
*z)
{
int i;
#pragma omp parallel
{
#pragma omp for schedule(static) nowait
for (i=0; i<n; i++)
c[i] = (a[i] + b[i]) / 2.0f;
#pragma omp for schedule(static) nowait
for (i=0; i<n; i++)
z[i] = sqrtf(c[i]);
#pragma omp for schedule(static) nowait
for (i=1; i<=n; i++)
y[i] = z[i-1] + a[i];
}
}