1 /* Based on sollve_vv's tests/5.0/declare_target/test_nested_declare_target.c. */
10 for (i
= 0; i
< N
; i
++)
18 #pragma omp declare target
19 #pragma omp declare target link(a,c,b,i)
20 #pragma omp declare target to(update)
21 #pragma omp end declare target
26 for (i
= 0; i
< N
; i
++)
33 //__builtin_printf("i=5: A=%d, B=%d, C=%d\n", a[5], b[5], c[5]);
35 #pragma omp target map(to: i) map(tofrom: a, b, c)
37 update(); /* Device. */
40 //__builtin_printf("i=5: A=%d, B=%d, C=%d\n", a[5], b[5], c[5]);
42 for (i
= 0; i
< N
; i
++)
43 if ( a
[i
] != i
+ 1 || b
[i
] != i
+ 3 || c
[i
] != i
+ 5)
48 //__builtin_printf("i=5: A=%d, B=%d, C=%d\n", a[5], b[5], c[5]);
50 for (i
= 0; i
< N
; i
++)
51 if ( a
[i
] != i
+ 2 || b
[i
] != i
+ 5 || c
[i
] != i
+ 8)