1 // RUN: %libomptarget-compilexx-run-and-check-generic
8 int tid
= 0, bid
= 0, bdim
= 0;
9 #pragma omp target teams distribute parallel for map(from \
11 device(device) thread_limit(2) num_teams(5)
12 for (int i
= 0; i
< 1000; ++i
) {
14 tid
= ompx::block_dim_x();
15 bid
= ompx::block_id_x();
16 bdim
= ompx::grid_dim_x();
19 // CHECK: tid: 2, bid: 1, bdim: 5
20 // CHECK: tid: 2, bid: 0, bdim: 1
21 printf("tid: %i, bid: %i, bdim: %i\n", tid
, bid
, bdim
);
24 int isGPU() { return 0; }
25 #pragma omp declare variant(isGPU) match(device = {kind(gpu)})
26 int isGPUvariant() { return 1; }
30 #pragma omp target map(from : r)
37 foo(omp_get_default_device());
39 printf("tid: 2, bid: 1, bdim: 5\n");
40 foo(omp_get_initial_device());