MCPcopy Create free account
hub / github.com/comaps/comaps / TakeGPUMemorySnapshot

Method TakeGPUMemorySnapshot

libs/drape_frontend/drape_measurer.cpp:421–459  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

419}
420
421void DrapeMeasurer::TakeGPUMemorySnapshot()
422{
423 dp::GPUMemTracker::GPUMemorySnapshot snap = dp::GPUMemTracker::Inst().GetMemorySnapshot();
424 for (auto const & tagPair : snap.m_tagStats)
425 {
426 auto itMax = m_maxSnapshotValues.m_tagStats.find(tagPair.first);
427 if (itMax != m_maxSnapshotValues.m_tagStats.end())
428 {
429 itMax->second.m_objectsCount = std::max(itMax->second.m_objectsCount, tagPair.second.m_objectsCount);
430 itMax->second.m_alocatedInMb = std::max(itMax->second.m_alocatedInMb, tagPair.second.m_alocatedInMb);
431 itMax->second.m_usedInMb = std::max(itMax->second.m_alocatedInMb, tagPair.second.m_usedInMb);
432 }
433 else
434 {
435 m_maxSnapshotValues.m_tagStats.insert(tagPair);
436 }
437
438 auto itSummary = m_summarySnapshotValues.m_tagStats.find(tagPair.first);
439 if (itSummary != m_summarySnapshotValues.m_tagStats.end())
440 {
441 itSummary->second.m_objectsCount += tagPair.second.m_objectsCount;
442 itSummary->second.m_alocatedInMb += tagPair.second.m_alocatedInMb;
443 itSummary->second.m_usedInMb += tagPair.second.m_usedInMb;
444 }
445 else
446 {
447 m_summarySnapshotValues.m_tagStats.insert(tagPair);
448 }
449 }
450
451 m_maxSnapshotValues.m_summaryAllocatedInMb =
452 std::max(snap.m_summaryAllocatedInMb, m_maxSnapshotValues.m_summaryAllocatedInMb);
453 m_maxSnapshotValues.m_summaryUsedInMb = std::max(snap.m_summaryUsedInMb, m_maxSnapshotValues.m_summaryUsedInMb);
454
455 m_summarySnapshotValues.m_summaryAllocatedInMb += snap.m_summaryAllocatedInMb;
456 m_summarySnapshotValues.m_summaryUsedInMb += snap.m_summaryUsedInMb;
457
458 ++m_numberOfSnapshots;
459}
460
461DrapeMeasurer::GPUMemoryStatistic DrapeMeasurer::GetGPUMemoryStatistic()
462{

Callers

nothing calls this directly

Calls 4

GetMemorySnapshotMethod · 0.80
findMethod · 0.45
endMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected