Optimize Level Zero indirect allocations handling.

Make them resident directly instead of populating residency container
Remove finds, not needed, CSR resolves duplicates at makeResident calls
Observed gain is 32x for 10k indirect allocations.


Co-authored-by: Michal Mrozek <michal.mrozek@intel.com>

Co-authored-by: Dominik Dabek <dominik.dabek@intel.com>

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
This commit is contained in:
Michal Mrozek
2022-01-14 13:56:53 +00:00
committed by Compute-Runtime-Automation
parent 513e6a2ee4
commit 3ecbc55ba9
9 changed files with 192 additions and 79 deletions

View File

@@ -252,6 +252,12 @@ class MockCsrHw2 : public CommandStreamReceiverHw<GfxFamily> {
return taskCount;
}
void makeSurfacePackNonResident(ResidencyContainer &allocationsForResidency) override {
for (auto &surface : allocationsForResidency) {
rememberedResidencies.push_back(surface);
}
CommandStreamReceiver::makeSurfacePackNonResident(allocationsForResidency);
}
void programHardwareContext(LinearStream &cmdStream) override {
programHardwareContextCalled = true;
}
@@ -261,6 +267,7 @@ class MockCsrHw2 : public CommandStreamReceiverHw<GfxFamily> {
std::unique_ptr<uint8_t> storedTaskStream;
size_t storedTaskStreamSize = 0;
ResidencyContainer rememberedResidencies;
int flushCalledCount = 0;
std::unique_ptr<CommandBuffer> recordedCommandBuffer = nullptr;
ResidencyContainer copyOfAllocations;