Joseph Huber | 1616407 | 2021-07-14 21:04:54 | [diff] [blame] | 1 | Generic-mode kernel is executed with a customized state machine that requires a fallback. [OMP132] |
| 2 | ================================================================================================== |
| 3 | |
| 4 | .. _omp132: |
| 5 | |
| 6 | This analysis remark indicates that a state machine rewrite occurred, but |
| 7 | could not be done fully because of unknown calls to functions that may contain |
| 8 | parallel regions. The state machine handles scheduling work between parallel |
| 9 | worker threads on the device when operating in generic-mode. If there are |
| 10 | unknown parallel regions it prevents the optimization from fully rewriting the |
| 11 | state machine. |
| 12 | |
| 13 | Examples |
| 14 | -------- |
| 15 | |
| 16 | This will occur for any generic-mode kernel that may contain unknown parallel |
| 17 | regions. This is typically coupled with the :ref:`OMP133 <omp133>` remark. |
| 18 | |
| 19 | .. code-block:: c++ |
| 20 | |
| 21 | extern void setup(); |
| 22 | |
| 23 | void foo() { |
| 24 | #pragma omp target |
| 25 | { |
| 26 | setup(); |
| 27 | #pragma omp parallel |
| 28 | { |
| 29 | work(); |
| 30 | } |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | .. code-block:: console |
| 35 | |
| 36 | $ clang++ -fopenmp -fopenmp-targets=nvptx64 -O2 -Rpass-analysis=openmp-opt omp132.cpp |
Shao-Ce SUN | 0c66025 | 2021-11-15 01:17:08 | [diff] [blame] | 37 | omp133.cpp:4:1: remark: Generic-mode kernel is executed with a customized state machine |
Joseph Huber | 1616407 | 2021-07-14 21:04:54 | [diff] [blame] | 38 | that requires a fallback. [OMP132] |
| 39 | #pragma omp target |
| 40 | ^ |
| 41 | |
| 42 | Diagnostic Scope |
| 43 | ---------------- |
| 44 | |
| 45 | OpenMP target offloading analysis remark. |