|
165 | 165 | #define OPDI_CRITICAL_NAME(name) \ |
166 | 166 | OPDI_PRAGMA(omp critical (name)) \ |
167 | 167 | { \ |
168 | | - std::size_t const opdiInternalCriticalIdentifier = \ |
169 | | - dynamic_cast<opdi::MacroBackend*>(opdi::backend)->getCriticalIdentifier(std::string(#name)); \ |
| 168 | + std::size_t const opdiInternalCriticalIdentifier = opdi::backend->getCriticalIdentifier(std::string(#name)); \ |
170 | 169 | opdi::logic->onMutexAcquired(opdi::LogicInterface::MutexKind::Critical, opdiInternalCriticalIdentifier); |
171 | 170 |
|
172 | 171 | #define OPDI_CRITICAL_NAME_ARGS(name, ...) \ |
173 | 172 | OPDI_PRAGMA(omp critical (name) __VA_ARGS__) \ |
174 | 173 | { \ |
175 | | - std::size_t const opdiInternalCriticalIdentifier = \ |
176 | | - dynamic_cast<opdi::MacroBackend*>(opdi::backend)->getCriticalIdentifier(std::string(#name)); \ |
| 174 | + std::size_t const opdiInternalCriticalIdentifier = opdi::backend->getCriticalIdentifier(std::string(#name)); \ |
177 | 175 | opdi::logic->onMutexAcquired(opdi::LogicInterface::MutexKind::Critical, opdiInternalCriticalIdentifier); |
178 | 176 |
|
179 | 177 | #define OPDI_END_CRITICAL \ |
|
236 | 234 | // reduction macros |
237 | 235 |
|
238 | 236 | #if _OPENMP >= 202411 |
239 | | - #define OPDI_INTERNAL_DECLARE_REDUCTION(OP_NAME, TYPE, OP, INIT, ID) \ |
240 | | - TYPE operator OP (opdi::Reducer<TYPE, ID> const& lhs, \ |
241 | | - opdi::Reducer<TYPE, ID> const& rhs) { \ |
| 237 | + #define OPDI_DECLARE_REDUCTION(OP_NAME, TYPE, OP, INIT) \ |
| 238 | + TYPE operator OP (opdi::Reducer<TYPE> const& lhs, \ |
| 239 | + opdi::Reducer<TYPE> const& rhs) { \ |
242 | 240 | return lhs.value OP rhs.value; \ |
243 | 241 | } \ |
244 | 242 | \ |
245 | 243 | OPDI_PRAGMA(omp declare_reduction(OP_NAME : TYPE) \ |
246 | | - combiner(opdi::Reducer<TYPE, ID>(omp_out) = \ |
247 | | - opdi::Reducer<TYPE, ID>(omp_out) OP opdi::Reducer<TYPE, ID>(omp_in)) \ |
| 244 | + combiner(opdi::Reducer(omp_out) = opdi::Reducer(omp_out) OP opdi::Reducer(omp_in)) \ |
248 | 245 | initializer(omp_priv = INIT)) |
249 | 246 | #else |
250 | | - #define OPDI_INTERNAL_DECLARE_REDUCTION(OP_NAME, TYPE, OP, INIT, ID) \ |
251 | | - TYPE operator OP (opdi::Reducer<TYPE, ID> const& lhs, \ |
252 | | - opdi::Reducer<TYPE, ID> const& rhs) { \ |
| 247 | + #define OPDI_DECLARE_REDUCTION(OP_NAME, TYPE, OP, INIT) \ |
| 248 | + TYPE operator OP (opdi::Reducer<TYPE> const& lhs, \ |
| 249 | + opdi::Reducer<TYPE> const& rhs) { \ |
253 | 250 | return lhs.value OP rhs.value; \ |
254 | 251 | } \ |
255 | 252 | \ |
256 | 253 | OPDI_PRAGMA(omp declare reduction(OP_NAME : TYPE : \ |
257 | | - opdi::Reducer<TYPE, ID>(omp_out) = opdi::Reducer<TYPE, ID>(omp_out) OP opdi::Reducer<TYPE, ID>(omp_in)) \ |
| 254 | + opdi::Reducer(omp_out) = opdi::Reducer(omp_out) OP opdi::Reducer(omp_in)) \ |
258 | 255 | initializer(omp_priv = INIT)) |
259 | 256 | #endif |
260 | 257 |
|
261 | | -#define OPDI_DECLARE_REDUCTION(OP_NAME, TYPE, OP, INIT) \ |
262 | | - OPDI_INTERNAL_DECLARE_REDUCTION(OP_NAME, TYPE, OP, INIT, __COUNTER__) |
263 | | - |
264 | 258 | #define OPDI_REDUCTION private(opdi::internalReductionProbe) |
265 | 259 |
|
266 | 260 |
|
0 commit comments