2 // RUN: %libomptarget-compilexx-generic && %libomptarget-run-generic 2>&1 | %fcheck-generic
5 // UNSUPPORTED: aarch64-unknown-linux-gnu
6 // UNSUPPORTED: aarch64-unknown-linux-gnu-LTO
7 // UNSUPPORTED: x86_64-pc-linux-gnu
8 // UNSUPPORTED: x86_64-pc-linux-gnu-LTO
9 // UNSUPPORTED: s390x-ibm-linux-gnu
10 // UNSUPPORTED: s390x-ibm-linux-gnu-LTO
12 // REQUIRES: amdgcn-amd-amdhsa
19 bool schedule(int lb
, int ub
, int stride
, int chunk
) {
23 for (i
= 0; i
< N
; i
++) {
27 #pragma omp target map(tofrom : result[ : N])
30 #pragma omp parallel for schedule(dynamic, chunk)
31 for (i
= lb
; i
< ub
; i
+= stride
) {
38 for (i
= 0; i
< N
; i
+= stride
) {
39 if (value
!= result
[i
]) {
40 printf("ERROR: result[%d] = %d instead of %d\n", i
, result
[i
], value
);
51 // CHECK: SUCCESS CHUNK SIZE 1
52 if (schedule(0, N
, 5, 1))
53 printf("SUCCESS CHUNK SIZE 1\n");
55 // CHECK: SUCCESS CHUNK SIZE 3
56 if (schedule(0, N
, 5, 3))
57 printf("SUCCESS CHUNK SIZE 3\n");