1 // RUN: %libomptarget-compilexx-run-and-check-generic
10 int main(int argc
, char *argv
[]) {
11 #pragma omp parallel for
12 for (int i
= 0; i
< 16; ++i
) {
13 for (int n
= 1; n
< (1 << 13); n
<<= 1) {
14 void *p
= omp_target_alloc(n
* sizeof(int), 0);
15 omp_target_free(p
, 0);
19 #pragma omp parallel for
20 for (int i
= 0; i
< 16; ++i
) {
21 for (int n
= 1; n
< (1 << 13); n
<<= 1) {
22 int *p
= (int *)omp_target_alloc(n
* sizeof(int), 0);
23 #pragma omp target teams distribute parallel for is_device_ptr(p)
24 for (int j
= 0; j
< n
; ++j
) {
28 #pragma omp target teams distribute parallel for is_device_ptr(p) \
30 for (int j
= 0; j
< n
; ++j
) {
33 for (int j
= 0; j
< n
; ++j
) {
34 assert(buffer
[j
] == i
);
36 omp_target_free(p
, 0);
40 std::cout
<< "PASS\n";