8 extern "C" void abort (void);
10 void init (float *a1, float *a2, int n)
13 for (int i = 0; i < n; i++)
21 void check (float *a, float *b, int n)
23 for (int i = 0; i < n; i++)
24 if (a[i] - b[i] > EPS || b[i] - a[i] > EPS)
28 void vec_mult_ref (float *&p, float *&v1, float *&v2, int n)
30 for (int i = 0; i < n; i++)
34 void vec_mult (float *&p, float *&v1, float *&v2, int n)
36 #pragma omp target map(to: v1[0:n], v2[:n]) map(from: p[0:n])
37 #pragma omp parallel for
38 for (int i = 0; i < n; i++)
44 float *p = new float [N];
45 float *p1 = new float [N];
46 float *v1 = new float [N];
47 float *v2 = new float [N];
51 vec_mult_ref (p, v1, v2, N);
52 vec_mult (p1, v1, v2, N);