1 /* { dg-require-effective-target offload_device_nonshared_as } */
12 #pragma omp declare target
14 #pragma omp end declare target
16 void enter_data (int *X
)
18 #pragma omp target enter data map(to: var1, var2, X[:N]) map(alloc: sum)
21 void exit_data_0 (int *D
)
23 #pragma omp target exit data map(delete: D[:N])
28 #pragma omp target exit data map(from: var1)
31 void exit_data_2 (int *X
)
33 #pragma omp target exit data map(from: var2) map(release: X[:N], sum)
36 void exit_data_3 (int *p
)
38 #pragma omp target exit data map(from: p[:0])
43 int X
= 0, Y
= 0, Z
= 0;
45 #pragma omp target data map(from: X, Y, Z)
47 #pragma omp target data map(from: X, Y, Z)
49 #pragma omp target map(from: X, Y, Z)
55 #pragma omp target exit data map(from: X) map(release: Y)
59 #pragma omp target exit data map(release: Y) map(delete: Z)
67 #pragma omp target map(from: X)
82 int *X
= malloc (N
* sizeof (int));
83 int *Y
= malloc (N
* sizeof (int));
88 exit_data_0 (D
); /* This should have no effect on D. */
90 #pragma omp target map(alloc: var1, var2, X[:N]) map(to: Y[:N]) map(always from: sum)
106 /* Increase refcount of already mapped X[0:N]. */
107 #pragma omp target enter data map(alloc: X[16:1])
112 exit_data_3 (X
+ 5); /* Unmap X[0:N]. */