| 419 | } |
| 420 | |
| 421 | void 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 | |
| 461 | DrapeMeasurer::GPUMemoryStatistic DrapeMeasurer::GetGPUMemoryStatistic() |
| 462 | { |
nothing calls this directly
no test coverage detected