1 // RUN: %libomptarget-compilexx-run-and-check-generic
12 std::size_t bytes
= size
* sizeof(int);
13 const int host_id
= omp_get_initial_device();
14 const int device_id
= omp_get_default_device();
15 data_host
= (int *)malloc(bytes
);
16 data_device
= (int *)omp_target_alloc(bytes
, device_id
);
17 #pragma omp target teams distribute parallel for is_device_ptr(data_device)
18 for (int i
= 0; i
< size
; ++i
)
20 omp_target_memcpy(data_host
, data_device
, bytes
, 0, 0, host_id
, device_id
);
21 for (int i
= 0; i
< size
; ++i
)
22 assert(data_host
[i
] == i
);