|
79 | 79 | #define OPDI_SINGLE_NOWAIT(...) \ |
80 | 80 | { \ |
81 | 81 | bool constexpr opdiInternalBarrierIndicator = false; \ |
82 | | - void* opdiInternalTapePosition = opdi::tool->allocPosition(); \ |
83 | | - opdi::tool->getTapePosition(opdi::tool->getThreadLocalTape(), opdiInternalTapePosition); \ |
| 82 | + void* opdiInternalTapePosition1 = opdi::tool->allocPosition(); \ |
| 83 | + void* opdiInternalTapePosition2 = opdi::tool->allocPosition(); /* for consistency with the end macro */ \ |
| 84 | + opdi::tool->getTapePosition(opdi::tool->getThreadLocalTape(), opdiInternalTapePosition1); \ |
84 | 85 | opdi::logic->onSyncRegion(opdi::LogicInterface::SyncRegionKind::BarrierImplementation, \ |
85 | 86 | opdi::LogicInterface::ScopeEndpoint::Begin); \ |
86 | 87 | opdi::ImplicitBarrierTools::beginRegionWithImplicitBarrier(); \ |
87 | 88 | { \ |
88 | 89 | opdi::SingleProbe localSingleProbe; \ |
89 | 90 | OPDI_PRAGMA(omp single nowait __VA_ARGS__) \ |
90 | 91 | { \ |
91 | | - opdi::tool->reset(opdi::tool->getThreadLocalTape(), opdiInternalTapePosition); |
| 92 | + opdi::tool->reset(opdi::tool->getThreadLocalTape(), opdiInternalTapePosition1); |
92 | 93 |
|
93 | 94 | #define OPDI_END_SINGLE \ |
94 | 95 | opdi::logic->onSyncRegion(opdi::LogicInterface::SyncRegionKind::BarrierImplementation, \ |
|
97 | 98 | opdi::logic->onSyncRegion(opdi::LogicInterface::SyncRegionKind::BarrierImplementation, \ |
98 | 99 | opdi::LogicInterface::ScopeEndpoint::End); \ |
99 | 100 | } \ |
| 101 | + opdi::tool->freePosition(opdiInternalTapePosition1); \ |
| 102 | + opdi::tool->freePosition(opdiInternalTapePosition2); \ |
100 | 103 | opdi::ImplicitBarrierTools::implicitBarrierStack.top() = opdiInternalBarrierIndicator; \ |
101 | 104 | opdi::ImplicitBarrierTools::endRegionWithImplicitBarrier(); \ |
102 | 105 | } |
|
0 commit comments