Joseph Huber | 6242f9b | 2021-07-20 16:04:13 | [diff] [blame] | 1 | .. _omp130: |
| 2 | |
Joseph Huber | 1616407 | 2021-07-14 21:04:54 | [diff] [blame] | 3 | Removing unused state machine from generic-mode kernel. [OMP130] |
| 4 | ================================================================ |
| 5 | |
Joseph Huber | 1616407 | 2021-07-14 21:04:54 | [diff] [blame] | 6 | This optimization remark indicates that an unused state machine was removed from |
| 7 | a target region. This occurs when there are no parallel regions inside of a |
| 8 | target construct. Normally, a state machine is required to schedule the threads |
| 9 | inside of a parallel region. If there are no parallel regions, the state machine |
Shao-Ce SUN | 0c66025 | 2021-11-15 01:17:08 | [diff] [blame] | 10 | is unnecessary because there is only a single thread active at any time. |
Joseph Huber | 1616407 | 2021-07-14 21:04:54 | [diff] [blame] | 11 | |
| 12 | Examples |
| 13 | -------- |
| 14 | |
| 15 | This optimization should occur on any target region that does not contain any |
| 16 | parallel work. |
| 17 | |
| 18 | .. code-block:: c++ |
| 19 | |
| 20 | void copy(int N, double *X, double *Y) { |
| 21 | #pragma omp target teams distribute map(tofrom: X[0:N]) map(tofrom: Y[0:N]) |
| 22 | for (int i = 0; i < N; ++i) |
| 23 | Y[i] = X[i]; |
| 24 | } |
| 25 | |
| 26 | .. code-block:: console |
| 27 | |
| 28 | $ clang++ -fopenmp -fopenmp-targets=nvptx64 -O2 -Rpass=openmp-opt omp130.cpp |
| 29 | omp130.cpp:2:1: remark: Removing unused state machine from generic-mode kernel. [OMP130] |
| 30 | #pragma omp target teams distribute map(tofrom: X[0:N]) map(tofrom: Y[0:N]) |
| 31 | ^ |
| 32 | |
| 33 | Diagnostic Scope |
| 34 | ---------------- |
| 35 | |
| 36 | OpenMP target offloading optimization remark. |