9 if (omp_in_parallel ())
11 #pragma omp parallel num_threads (3)
12 if (omp_get_thread_num () == 2)
14 if (!omp_in_parallel ())
16 #pragma omp parallel num_threads (3)
17 if (omp_get_thread_num () == 1)
19 if (!omp_in_parallel ()
20 || omp_get_level () != 2
21 || omp_get_ancestor_thread_num (0) != 0
22 || omp_get_ancestor_thread_num (1) != 2
23 || omp_get_ancestor_thread_num (2) != 1
24 || omp_get_ancestor_thread_num (3) != -1)
26 #pragma omp target if (0)
28 if (omp_in_parallel ()
29 || omp_get_level () != 0
30 || omp_get_ancestor_thread_num (0) != 0
31 || omp_get_ancestor_thread_num (1) != -1)
33 #pragma omp parallel num_threads (2)
35 if (!omp_in_parallel ()
36 || omp_get_level () != 1
37 || omp_get_ancestor_thread_num (0) != 0
38 || omp_get_ancestor_thread_num (1)
39 != omp_get_thread_num ()
40 || omp_get_ancestor_thread_num (2) != -1)
44 #pragma omp target if (0)
46 #pragma omp teams thread_limit (2)
48 if (omp_in_parallel ()
49 || omp_get_level () != 0
50 || omp_get_ancestor_thread_num (0) != 0
51 || omp_get_ancestor_thread_num (1) != -1)
53 #pragma omp parallel num_threads (2)
55 if (!omp_in_parallel ()
56 || omp_get_level () != 1
57 || omp_get_ancestor_thread_num (0) != 0
58 || omp_get_ancestor_thread_num (1)
59 != omp_get_thread_num ()
60 || omp_get_ancestor_thread_num (2) != -1)