| 1 |
/* { dg-do run } */ |
| 2 |
/* { dg-skip-if "" { *-*-* } { "-DACC_MEM_SHARED=1" } } */ |
| 3 |
|
| 4 |
/* Test if acc_unmap_data has implicit finalize semantics. */ |
| 5 |
|
| 6 |
#include <stdlib.h> |
| 7 |
#include <openacc.h> |
| 8 |
|
| 9 |
int |
| 10 |
main (int argc, char **argv) |
| 11 |
{ |
| 12 |
const int N = 256; |
| 13 |
unsigned char *h; |
| 14 |
void *d; |
| 15 |
|
| 16 |
h = (unsigned char *) malloc (N); |
| 17 |
|
| 18 |
d = acc_malloc (N); |
| 19 |
|
| 20 |
acc_map_data (h, d, N); |
| 21 |
|
| 22 |
acc_copyin (h, N); |
| 23 |
acc_copyin (h, N); |
| 24 |
acc_copyin (h, N); |
| 25 |
|
| 26 |
acc_unmap_data (h); |
| 27 |
|
| 28 |
if (acc_is_present (h, N)) |
| 29 |
abort (); |
| 30 |
|
| 31 |
acc_free (d); |
| 32 |
|
| 33 |
free (h); |
| 34 |
|
| 35 |
return 0; |
| 36 |
} |