19 sc0 (sa0 &my_a, sb0 &my_b) : a(my_a), b(my_b) {}
28 my_a.ptr = (int *) malloc (sizeof (int) * 10);
31 memset (my_c.a.ptr, 0, sizeof (int) * 10);
33 #pragma omp target map (my_c.a.ptr, my_c.a.ptr[:10])
35 for (int i = 0; i < 10; i++)
39 for (int i = 0; i < 10; i++)
40 assert (my_c.a.ptr[i] == i);
42 memset (my_c.b.arr, 0, sizeof (int) * 10);
44 #pragma omp target map (my_c.b.arr[:10])
46 for (int i = 0; i < 10; i++)
50 for (int i = 0; i < 10; i++)
51 assert (my_c.b.arr[i] == i);
70 sc (sa &my_a, sb &my_b) : a(my_a), b(my_b) {}
79 my_a.ptr = (int *) malloc (sizeof (int) * 10);
82 memset (my_c.a.ptr, 0, sizeof (int) * 10);
84 #pragma omp target map (my_c.a.ptr, my_c.a.ptr[:10])
86 for (int i = 0; i < 10; i++)
90 for (int i = 0; i < 10; i++)
91 assert (my_c.a.ptr[i] == i);
93 memset (my_c.b.arr, 0, sizeof (int) * 10);
95 #pragma omp target map (my_c.b.arr[:10])
97 for (int i = 0; i < 10; i++)
101 for (int i = 0; i < 10; i++)
102 assert (my_c.b.arr[i] == i);
113 my_a.ptr = (int *) malloc (sizeof (int) * 10);
117 memset (my_cref.a.ptr, 0, sizeof (int) * 10);
119 #pragma omp target map (my_cref.a.ptr, my_cref.a.ptr[:10])
121 for (int i = 0; i < 10; i++)
122 my_cref.a.ptr[i] = i;
125 for (int i = 0; i < 10; i++)
126 assert (my_cref.a.ptr[i] == i);
128 memset (my_cref.b.arr, 0, sizeof (int) * 10);
130 #pragma omp target map (my_cref.b.arr[:10])
132 for (int i = 0; i < 10; i++)
133 my_cref.b.arr[i] = i;
136 for (int i = 0; i < 10; i++)
137 assert (my_cref.b.arr[i] == i);
146 scp0 (sa *my_a, sb *my_b) : a(my_a), b(my_b) {}
155 my_a->ptr = new int[10];
156 scp0 *my_c = new scp0(my_a, my_b);
158 memset (my_c->a->ptr, 0, sizeof (int) * 10);
160 #pragma omp target map (my_c->a, my_c->a[:1], my_c->a->ptr, my_c->a->ptr[:10])
162 for (int i = 0; i < 10; i++)
166 for (int i = 0; i < 10; i++)
167 assert (my_c->a->ptr[i] == i);
169 memset (my_c->b->arr, 0, sizeof (int) * 10);
171 #pragma omp target map (my_c->b, my_c->b[:1], my_c->b->arr[:10])
173 for (int i = 0; i < 10; i++)
177 for (int i = 0; i < 10; i++)
178 assert (my_c->b->arr[i] == i);
189 scp (sa *&my_a, sb *&my_b) : a(my_a), b(my_b) {}
198 my_a->ptr = new int[10];
199 scp *my_c = new scp(my_a, my_b);
201 memset (my_c->a->ptr, 0, sizeof (int) * 10);
203 #pragma omp target map (my_c->a, my_c->a[:1], my_c->a->ptr, my_c->a->ptr[:10])
205 for (int i = 0; i < 10; i++)
209 for (int i = 0; i < 10; i++)
210 assert (my_c->a->ptr[i] == i);
212 memset (my_c->b->arr, 0, sizeof (int) * 10);
214 #pragma omp target map (my_c->b, my_c->b[:1], my_c->b->arr[:10])
216 for (int i = 0; i < 10; i++)
220 for (int i = 0; i < 10; i++)
221 assert (my_c->b->arr[i] == i);
234 my_a->ptr = new int[10];
235 scp *my_c = new scp(my_a, my_b);
236 scp *&my_cref = my_c;
238 memset (my_cref->a->ptr, 0, sizeof (int) * 10);
240 #pragma omp target map (my_cref->a, my_cref->a[:1], my_cref->a->ptr, \
241 my_cref->a->ptr[:10])
243 for (int i = 0; i < 10; i++)
244 my_cref->a->ptr[i] = i;
247 for (int i = 0; i < 10; i++)
248 assert (my_cref->a->ptr[i] == i);
250 memset (my_cref->b->arr, 0, sizeof (int) * 10);
252 #pragma omp target map (my_cref->b, my_cref->b[:1], my_cref->b->arr[:10])
254 for (int i = 0; i < 10; i++)
255 my_cref->b->arr[i] = i;
258 for (int i = 0; i < 10; i++)
259 assert (my_cref->b->arr[i] == i);
266 int main (int argc, char *argv[])