| 2339 | } |
| 2340 | |
| 2341 | const FabArrayBase::TileArray* |
| 2342 | FabArrayBase::getTileArray (const IntVect& tilesize) const |
| 2343 | { |
| 2344 | TileArray* p; |
| 2345 | |
| 2346 | #ifdef AMREX_USE_OMP |
| 2347 | #pragma omp critical(gettilearray) |
| 2348 | #endif |
| 2349 | { |
| 2350 | BL_ASSERT(getBDKey() == m_bdkey); |
| 2351 | |
| 2352 | const IntVect& crse_ratio = boxArray().crseRatio(); |
| 2353 | p = &FabArrayBase::m_TheTileArrayCache[m_bdkey][std::pair<IntVect,IntVect>(tilesize,crse_ratio)]; |
| 2354 | if (p->nuse == -1) { |
| 2355 | buildTileArray(tilesize, *p); |
| 2356 | p->nuse = 0; |
| 2357 | m_TAC_stats.recordBuild(); |
| 2358 | #ifdef AMREX_MEM_PROFILING |
| 2359 | m_TAC_stats.bytes += p->bytes(); |
| 2360 | m_TAC_stats.bytes_hwm = std::max(m_TAC_stats.bytes_hwm, |
| 2361 | m_TAC_stats.bytes); |
| 2362 | #endif |
| 2363 | } |
| 2364 | #ifdef AMREX_USE_OMP |
| 2365 | #pragma omp master |
| 2366 | #endif |
| 2367 | { |
| 2368 | ++(p->nuse); |
| 2369 | m_TAC_stats.recordUse(); |
| 2370 | } |
| 2371 | } |
| 2372 | |
| 2373 | return p; |
| 2374 | } |
| 2375 | |
| 2376 | void |
| 2377 | FabArrayBase::buildTileArray (const IntVect& tileSize, TileArray& ta) const |
no test coverage detected