2 // RUN: %libomptarget-compileopt-generic
3 // RUN: env LIBOMPTARGET_INFO=16 \
4 // RUN: %libomptarget-run-generic 2>&1 | %fcheck-generic --check-prefixes=CHECK,SPMD
5 // RUN: %libomptarget-compileopt-generic -mllvm --openmp-opt-disable-spmdization
6 // RUN: env LIBOMPTARGET_INFO=16 \
7 // RUN: %libomptarget-run-generic 2>&1 | %fcheck-generic --check-prefixes=CHECK,GENERIC
15 __attribute__((weak
)) void noop() {}
18 int nthreads
= 0, ip
= 0, lvl
= 0, alvl
= 0, nested
= 0, tid
= 0, maxt
= 0;
20 #pragma omp target map(from : nthreads, ip, lvl, alvl, nested, tid, maxt)
22 nthreads
= omp_get_num_threads();
23 ip
= omp_in_parallel();
24 lvl
= omp_get_level();
25 alvl
= omp_get_active_level();
26 nested
= omp_get_nested();
27 tid
= omp_get_thread_num();
28 maxt
= omp_get_max_threads();
32 printf("NumThreads: %i, InParallel: %i, Level: %i, ActiveLevel: %i, Nested: %i, "
33 "ThreadNum: %i, MaxThreads: %i\n",
34 nthreads
, ip
, lvl
, alvl
, nested
, tid
, maxt
);
35 // GENERIC: Generic mode
36 // SPMD: Generic-SPMD mode
37 // CHECK: NumThreads: 1
38 // CHECK: InParallel: 0
40 // CHECK: ActiveLevel: 0
42 // CHECK: ThreadNum: 0