1 // RUN: %libomptarget-compileopt-run-and-check-generic
15 int main(int argc
, char **argv
) {
20 struct info
*X
= (struct info
*)malloc(sizeof(*X
) * N
);
21 memset(X
, '0', sizeof(*X
) * N
);
24 int NT
= (N
+ TL
- 1) / TL
;
26 #pragma omp target data map(tofrom : X [0:N])
27 #pragma omp target teams num_teams(NT) thread_limit(TL)
31 int tid
= ompx_thread_id_x();
32 int bid
= ompx_block_id_x();
33 int tdim
= ompx_block_dim_x();
34 int gid
= tid
+ bid
* tdim
;
43 int tid
= 0, bid
= 0, tdim
= 256;
44 for (int i
= 0; i
< N
; i
++) {
45 if (X
[i
].tid
!= tid
|| X
[i
].bid
!= bid
|| X
[i
].tdim
!= tdim
) {
46 printf("%i: %i vs %i, %i vs %i, %i vs %i\n", i
, X
[i
].tid
, tid
, X
[i
].bid
,
47 bid
, X
[i
].tdim
, tdim
);