| 1 |
/* { dg-set-target-env-var OMP_ALLOCATOR " omp_default_mem_space:alignment=512,pinned=false,access=all " } */ |
| 2 |
/* { dg-set-target-env-var OMP_DISPLAY_ENV "true" } */ |
| 3 |
|
| 4 |
/* We copied the environment string; hence, it may contain white space. */ |
| 5 |
/* { dg-output ".\\\[host\\\] OMP_ALLOCATOR = ' omp_default_mem_space:alignment=512,pinned=false,access=all '.*" } */ |
| 6 |
|
| 7 |
#include <stdint.h> |
| 8 |
#include <omp.h> |
| 9 |
|
| 10 |
int |
| 11 |
main () |
| 12 |
{ |
| 13 |
int *a, *b; |
| 14 |
a = omp_alloc (sizeof (int) * 1024, omp_null_allocator); |
| 15 |
|
| 16 |
omp_allocator_handle_t m = omp_get_default_allocator (); |
| 17 |
b = omp_alloc (sizeof (int) * 1024, m); |
| 18 |
|
| 19 |
if ((uintptr_t) a % 512 != 0) |
| 20 |
__builtin_abort (); |
| 21 |
|
| 22 |
if ((uintptr_t) b % 512 != 0) |
| 23 |
__builtin_abort (); |
| 24 |
omp_free (a, omp_null_allocator); |
| 25 |
omp_free (b, m); |
| 26 |
return 0; |
| 27 |
} |