8 fn1 (double *x
, double *y
, int z
)
11 for (i
= 0; i
< z
; i
++)
22 double b
[3 * x
], c
[3 * x
], d
[3 * x
], e
[3 * x
];
26 #pragma omp target map(to: b, c[:x], d[x:x], e) map(tofrom: s)
27 #pragma omp parallel for reduction(+:s)
28 for (i
= 0; i
< x
; i
++)
29 s
+= b
[i
] * c
[i
] + d
[x
+ i
] + sizeof (b
) - sizeof (c
);
37 double b
[3 * x
], c
[3 * x
], d
[3 * x
], e
[3 * x
];
41 #pragma omp target map(tofrom: s)
42 #pragma omp parallel for reduction(+:s)
43 for (i
= 0; i
< x
; i
++)
44 s
+= b
[i
] * c
[i
] + d
[i
];
52 double b
[3 * x
], c
[3 * x
], d
[3 * x
], e
[3 * x
];
56 #pragma omp target data map(from: b, c[:x], d[x:x], e)
58 #pragma omp target update to(b, c[:x], d[x:x], e)
59 #pragma omp target map(c[:x], d[x:x], s)
60 #pragma omp parallel for reduction(+:s)
61 for (i
= 0; i
< x
; i
++)
63 s
+= b
[i
] * c
[i
] + d
[x
+ i
] + sizeof (b
) - sizeof (c
);
69 for (i
= 0; i
< x
; i
++)
70 if (b
[i
] != i
+ 0.5 || c
[i
] != 0.5 - i
|| d
[x
+ i
] != 0.5 * i
)