1 | // clang-format off |
2 | // RUN: %libomptarget-compilexx-generic |
3 | // RUN: env LIBOMPTARGET_INFO=16 \ |
4 | // RUN: %libomptarget-run-generic 2>&1 | %fcheck-generic |
5 | |
6 | // UNSUPPORTED: aarch64-unknown-linux-gnu |
7 | // UNSUPPORTED: aarch64-unknown-linux-gnu-LTO |
8 | // UNSUPPORTED: x86_64-pc-linux-gnu |
9 | // UNSUPPORTED: x86_64-pc-linux-gnu-LTO |
10 | // UNSUPPORTED: s390x-ibm-linux-gnu |
11 | // UNSUPPORTED: s390x-ibm-linux-gnu-LTO |
12 | |
13 | int main(int argc, char *argv[]) { |
14 | constexpr const int block_size = 256; |
15 | constexpr const int grid_size = 4; |
16 | constexpr const int count = block_size * grid_size; |
17 | |
18 | int *data = new int[count]; |
19 | |
20 | #pragma omp target teams distribute parallel for thread_limit(block_size) map(from: data[0:count]) |
21 | for (int i = 0; i < count; ++i) |
22 | data[i] = i; |
23 | |
24 | for (int i = 0; i < count; ++i) |
25 | if (data[i] != i) |
26 | return 1; |
27 | |
28 | delete[] data; |
29 | |
30 | return 0; |
31 | } |
32 | |
33 | // CHECK: Launching kernel {{.*}} with 4 blocks and 256 threads in SPMD mode |
34 | |