1 // RUN: %libomptarget-compile-and-run-generic
3 // Test case for omp_target_memcpy_async, oringally from GCC
10 int d
= omp_get_default_device();
11 int id
= omp_get_initial_device();
15 if (d
< 0 || d
>= omp_get_num_devices())
18 p
= omp_target_alloc(130 * sizeof(int), d
);
22 for (i
= 0; i
< 128; i
++)
25 if (omp_target_memcpy_async(p
, q
, 128 * sizeof(int), sizeof(int), 0, d
, id
, 0,
33 for (i
= 0; i
< 128; ++i
)
35 if (omp_target_memcpy_async(q2
, p
, 128 * sizeof(int), 0, sizeof(int), id
, d
,
41 for (i
= 0; i
< 128; ++i
)
45 omp_target_free(p
, d
);