blob: 5a734479d495f2ab571310b8d7e66e2eb149cc03 [file] [log] [blame]
Sirraidec44fa3e2024-05-22 15:58:481Call may contain unknown parallel regions. Use `[[omp::assume("omp_no_parallelism")]]` to override. [OMP133]
Joseph Huber16164072021-07-14 21:04:542====================================================================================================================
3
4.. _omp133:
5
6This analysis remark identifies calls that prevented :ref:`OMP131 <omp131>` from
7providing the generic-mode kernel with a fully specialized state machine. This
8remark will identify each call that may contain unknown parallel regions that
9caused the kernel to require a fallback.
10
11Examples
12--------
13
14This will occur for any generic-mode kernel that may contain unknown parallel
15regions. This is typically coupled with the :ref:`OMP132 <omp132>` remark.
16
17.. code-block:: c++
18
19 extern void setup();
20
21 void foo() {
22 #pragma omp target
23 {
24 setup();
25 #pragma omp parallel
26 {
27 work();
28 }
29 }
30 }
31
32.. code-block:: console
33
34 $ clang++ -fopenmp -fopenmp-targets=nvptx64 -O2 -Rpass-analysis=openmp-opt omp133.cpp
Shao-Ce SUN0c660252021-11-15 01:17:0835 omp133.cpp:6:5: remark: Call may contain unknown parallel regions. Use
Sirraidec44fa3e2024-05-22 15:58:4836 `[[omp::assume("omp_no_parallelism")]]` to override. [OMP133]
Joseph Huber16164072021-07-14 21:04:5437 setup();
38 ^
39
40The remark suggests marking the function with the assumption that it contains no
41parallel regions. If this is done then the kernel will be rewritten with a fully
42specialized state machine.
43
44.. code-block:: c++
45
Sirraidec44fa3e2024-05-22 15:58:4846 [[omp::assume("omp_no_parallelism")]] extern void setup();
Joseph Huber16164072021-07-14 21:04:5447
48
49 void foo() {
50 #pragma omp target
51 {
52 setup();
53 #pragma omp parallel
54 {
55 work();
56 }
57 }
58 }
59
60.. code-block:: console
61
62 $ clang++ -fopenmp -fopenmp-targets=nvptx64 -O2 -Rpass=openmp-opt omp133.cpp
63 omp133.cpp:4:1: remark: Rewriting generic-mode kernel with a customized state machine. [OMP131]
64 #pragma omp target
65 ^
66
67Diagnostic Scope
68----------------
69
70OpenMP target offloading analysis remark.