| 228 | } |
| 229 | |
| 230 | void |
| 231 | MFIter::Finalize () |
| 232 | { |
| 233 | // avoid double finalize |
| 234 | if (finalized) { return; } |
| 235 | finalized = true; |
| 236 | |
| 237 | // mark as invalid |
| 238 | currentIndex = endIndex; |
| 239 | |
| 240 | #ifdef BL_USE_TEAM |
| 241 | if ( ! (flags & NoTeamBarrier) ) |
| 242 | ParallelDescriptor::MyTeam().MemoryBarrier(); |
| 243 | #endif |
| 244 | |
| 245 | #ifdef AMREX_USE_GPU |
| 246 | if (device_sync && device_sync_post) { |
| 247 | const int nstreams = std::min(endIndex, streams); |
| 248 | for (int i = 0; i < nstreams; ++i) { |
| 249 | Gpu::Device::setStreamIndex(i); |
| 250 | Gpu::streamSynchronize(); |
| 251 | } |
| 252 | } |
| 253 | |
| 254 | AMREX_GPU_ERROR_CHECK(); |
| 255 | Gpu::Device::resetStreamIndex(); |
| 256 | #endif |
| 257 | |
| 258 | if (m_fa) { |
| 259 | #ifdef AMREX_USE_OMP |
| 260 | #pragma omp barrier |
| 261 | #pragma omp single |
| 262 | #endif |
| 263 | m_fa->clearThisBD(); |
| 264 | } |
| 265 | if (m_fa) { |
| 266 | m_fa.reset(nullptr); |
| 267 | } |
| 268 | |
| 269 | #ifdef AMREX_USE_OMP |
| 270 | #pragma omp master |
| 271 | #endif |
| 272 | { |
| 273 | depth = 0; |
| 274 | } |
| 275 | } |
| 276 | |
| 277 | void |
| 278 | MFIter::Initialize () |
nothing calls this directly
no test coverage detected