mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
[3/n] Optimize indirect allocations handling.
Add new debug variable to trigger new mode. Signed-off-by: Michal Mrozek <michal.mrozek@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
0424f30782
commit
6df17f5a30
@ -747,6 +747,7 @@ TEST(UnifiedMemoryTest, givenInternalAllocationWhenItIsMadeResidentThenNewTracki
|
||||
unifiedMemoryManager->makeIndirectAllocationsResident(commandStreamReceiver, 1u);
|
||||
EXPECT_TRUE(graphicsAllocation->gpuAllocations.getDefaultGraphicsAllocation()->isResident(commandStreamReceiver.getOsContext().getContextId()));
|
||||
EXPECT_EQ(GraphicsAllocation::objectAlwaysResident, graphicsAllocation->gpuAllocations.getDefaultGraphicsAllocation()->getResidencyTaskCount(commandStreamReceiver.getOsContext().getContextId()));
|
||||
EXPECT_FALSE(graphicsAllocation->gpuAllocations.getDefaultGraphicsAllocation()->peekEvictable());
|
||||
|
||||
EXPECT_EQ(1u, unifiedMemoryManager->indirectAllocationsResidency.size());
|
||||
auto internalEntry = unifiedMemoryManager->indirectAllocationsResidency.find(&commandStreamReceiver)->second;
|
||||
|
@ -712,6 +712,26 @@ HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenMultipleMakeResidentWhenMa
|
||||
mm->freeGraphicsMemory(allocation1);
|
||||
}
|
||||
|
||||
HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, givenAllocationThatIsAlwaysResidentWhenMakeNonResidentIsCalledThenItIsNotMadeNonResident) {
|
||||
auto allocation1 = mm->allocateGraphicsMemoryWithProperties(MockAllocationProperties{csr->getRootDeviceIndex(), MemoryConstants::pageSize});
|
||||
|
||||
ASSERT_NE(nullptr, allocation1);
|
||||
|
||||
csr->makeResident(*allocation1);
|
||||
|
||||
allocation1->updateResidencyTaskCount(GraphicsAllocation::objectAlwaysResident, csr->getOsContext().getContextId());
|
||||
|
||||
EXPECT_NE(0u, csr->getResidencyAllocations().size());
|
||||
|
||||
csr->processResidency(csr->getResidencyAllocations(), 0u);
|
||||
csr->makeSurfacePackNonResident(csr->getResidencyAllocations());
|
||||
|
||||
EXPECT_EQ(0u, csr->getResidencyAllocations().size());
|
||||
EXPECT_TRUE(allocation1->isResident(csr->getOsContext().getContextId()));
|
||||
|
||||
mm->freeGraphicsMemory(allocation1);
|
||||
}
|
||||
|
||||
HWTEST_TEMPLATED_F(DrmCommandStreamEnhancedTest, GivenMemObjectCallsDrmCsrWhenMakingNonResidentThenMakeNonResidentWithGraphicsAllocation) {
|
||||
auto allocation1 = mm->allocateGraphicsMemoryWithProperties(MockAllocationProperties{csr->getRootDeviceIndex(), 0x1000});
|
||||
ASSERT_NE(nullptr, allocation1);
|
||||
|
@ -370,4 +370,6 @@ ExperimentalEnableSourceLevelDebugger = 0
|
||||
Force2dImageAsArray = -1
|
||||
ForceExtendedBufferSize = -1
|
||||
OverrideMaxAllocationSizeForMapReuseBufferInMb = -1
|
||||
OverrideMapReuseBufferSizeInMb = -1
|
||||
OverrideMapReuseBufferSizeInMb = -1
|
||||
MakeIndirectAllocationsResidentAsPack = -1
|
||||
|
||||
|
Reference in New Issue
Block a user