File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
openmp/libomptarget/test/offloading Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change
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
+
11
+ int main (int argc, char *argv[]) {
12
+ constexpr const int block_size = 256 ;
13
+ constexpr const int grid_size = 4 ;
14
+ constexpr const int count = block_size * grid_size;
15
+
16
+ int *data = new int [count];
17
+
18
+ #pragma omp target teams distribute parallel for thread_limit(block_size) map(from: data[0:count])
19
+ for (int i = 0 ; i < count; ++i)
20
+ data[i] = i;
21
+
22
+ for (int i = 0 ; i < count; ++i)
23
+ if (data[i] != i)
24
+ return 1 ;
25
+
26
+ delete[] data;
27
+
28
+ return 0 ;
29
+ }
30
+
31
+ // CHECK: Launching kernel {{.*}} with 4 blocks and 256 threads in SPMD mode
You can’t perform that action at this time.
0 commit comments