1 // RUN: %libomptarget-compileopt-run-and-check-generic
3 // UNSUPPORTED: x86_64-pc-linux-gnu
4 // UNSUPPORTED: x86_64-pc-linux-gnu-LTO
5 // UNSUPPORTED: aarch64-unknown-linux-gnu
6 // UNSUPPORTED: aarch64-unknown-linux-gnu-LTO
18 int main(int argc
, char **argv
) {
23 struct info
*X
= (struct info
*)malloc(sizeof(*X
) * N
);
24 memset(X
, '0', sizeof(*X
) * N
);
27 int NT
= (N
+ TL
- 1) / TL
;
29 #pragma omp target data map(tofrom : X [0:N])
30 #pragma omp target teams num_teams(NT) thread_limit(TL)
34 int tid
= ompx_thread_id_x();
35 int bid
= ompx_block_id_x();
36 int tdim
= ompx_block_dim_x();
37 int gid
= tid
+ bid
* tdim
;
46 int tid
= 0, bid
= 0, tdim
= 256;
47 for (int i
= 0; i
< N
; i
++) {
48 if (X
[i
].tid
!= tid
|| X
[i
].bid
!= bid
|| X
[i
].tdim
!= tdim
) {
49 printf("%i: %i vs %i, %i vs %i, %i vs %i\n", i
, X
[i
].tid
, tid
, X
[i
].bid
,
50 bid
, X
[i
].tdim
, tdim
);