]>
gcc.gnu.org Git - gcc.git/blob - libgomp/testsuite/libgomp.c/examples-4/teams-3.c
8 void init (float B
[], float C
[], int n
)
11 for (i
= 0; i
< n
; i
++)
18 float dotprod_ref (float B
[], float C
[], int n
)
23 for (i
= 0; i
< n
; i
++)
29 float dotprod (float B
[], float C
[], int n
)
34 #pragma omp target teams map(to: B[0:n], C[0:n])
35 #pragma omp distribute parallel for reduction(+:sum)
36 for (i
= 0; i
< n
; i
++)
42 void check (float a
, float b
)
44 float err
= (b
== 0.0) ? a
: (a
- b
) / b
;
45 if (((err
> 0) ? err
: -err
) > EPS
)
51 float *v1
= (float *) malloc (N
* sizeof (float));
52 float *v2
= (float *) malloc (N
* sizeof (float));
58 p1
= dotprod_ref (v1
, v2
, N
);
59 p2
= dotprod (v1
, v2
, N
);
This page took 0.038231 seconds and 5 git commands to generate.