1 struct S
{ int s
, t
; };
5 struct S d
= { 8888, 8888 };
6 #pragma omp declare target link (a) to (b) link (c, d)
22 return *p1
+ *p2
+ d
.s
+ d
.t
;
25 #pragma omp declare target (foo, bar)
35 #pragma omp target map (to: a, b, c, d) map (from: res)
37 res
= foo () + foo ();
43 #pragma omp target map (alloc: shared_mem)
46 if ((shared_mem
&& res
!= (2 + 2) + (3 + 3) + (4 + 4 + 15 + 16))
47 || (!shared_mem
&& res
!= (2 + 1) + (3 + 2) + (4 + 3 + 15 + 16)))
50 #pragma omp target enter data map (to: c)
51 #pragma omp target update from (c)
52 res
= (int) (c
[n
] + 0.5);
53 if ((shared_mem
&& res
!= 5) || (!shared_mem
&& res
!= 0))
56 #pragma omp target map (to: a, b) map (from: res)
59 if ((shared_mem
&& res
!= 4 + 4) || (!shared_mem
&& res
!= 2 + 3))