71 lines · plain
1Call may contain unknown parallel regions. Use `[[omp::assume("omp_no_parallelism")]]` to override. [OMP133]2====================================================================================================================3 4.. _omp133:5 6This analysis remark identifies calls that prevented :ref:`OMP131 <omp131>` from7providing the generic-mode kernel with a fully specialized state machine. This8remark will identify each call that may contain unknown parallel regions that9caused the kernel to require a fallback.10 11Examples12--------13 14This will occur for any generic-mode kernel that may contain unknown parallel15regions. 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 target23 {24 setup();25 #pragma omp parallel26 {27 work();28 }29 }30 }31 32.. code-block:: console33 34 $ clang++ -fopenmp -fopenmp-targets=nvptx64 -O2 -Rpass-analysis=openmp-opt omp133.cpp35 omp133.cpp:6:5: remark: Call may contain unknown parallel regions. Use36 `[[omp::assume("omp_no_parallelism")]]` to override. [OMP133]37 setup();38 ^39 40The remark suggests marking the function with the assumption that it contains no41parallel regions. If this is done then the kernel will be rewritten with a fully42specialized state machine.43 44.. code-block:: c++45 46 [[omp::assume("omp_no_parallelism")]] extern void setup();47 48 49 void foo() {50 #pragma omp target51 {52 setup();53 #pragma omp parallel54 {55 work();56 }57 }58 }59 60.. code-block:: console61 62 $ clang++ -fopenmp -fopenmp-targets=nvptx64 -O2 -Rpass=openmp-opt omp133.cpp63 omp133.cpp:4:1: remark: Rewriting generic-mode kernel with a customized state machine. [OMP131]64 #pragma omp target65 ^66 67Diagnostic Scope68----------------69 70OpenMP target offloading analysis remark.71