1 extern void abort (void);
2 #pragma omp declare target
3 int a
[4] = { 2, 3, 4, 5 }, *b
;
4 #pragma omp end declare target
10 int c
[3] = { 6, 7, 8 };
12 #pragma omp target map(to: a[0:2], b[0:2]) map(from: err)
13 err
= a
[0] != 2 || a
[1] != 3 || a
[2] != 4 || a
[3] != 5 || b
[0] != 6 || b
[1] != 7;
18 #pragma omp target map(always,to:a[1:2]) map(from: err)
19 err
= a
[0] != 2 || a
[1] != 9 || a
[2] != 10 || a
[3] != 5;
22 #pragma omp parallel firstprivate(a, b, c, err) num_threads (2)
30 #pragma omp target map(to: a[0:3], b[d:2]) map (from: err)
31 err
= a
[0] != 11 || a
[1] != 9 || a
[2] != 13 || b
[0] != 14 || b
[1] != 8;