mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 13:33:02 +08:00
fix: update task count when object is always resident
Related-To: NEO-11537 Signed-off-by: Szymon Morek <szymon.morek@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
5df982a85d
commit
2c2ff5e369
@@ -170,6 +170,7 @@ void CommandStreamReceiver::makeResident(GraphicsAllocation &gfxAllocation) {
|
||||
}
|
||||
}
|
||||
}
|
||||
gfxAllocation.updateTaskCount(submissionTaskCount, osContext->getContextId());
|
||||
gfxAllocation.updateResidencyTaskCount(submissionTaskCount, osContext->getContextId());
|
||||
}
|
||||
|
||||
|
||||
@@ -5251,6 +5251,26 @@ HWTEST_F(CommandStreamReceiverTest, givenCsrWhenInitializeDeviceWithFirstSubmiss
|
||||
EXPECT_EQ(1u, commandStreamReceiver.taskCount);
|
||||
}
|
||||
|
||||
HWTEST_F(CommandStreamReceiverTest, givenCsrWhenMakeResidentCalledThenUpdateTaskCountIfObjectIsAlwaysResident) {
|
||||
auto &csr = pDevice->getUltCommandStreamReceiver<FamilyType>();
|
||||
auto contextId = csr.getOsContext().getContextId();
|
||||
MockGraphicsAllocation graphicsAllocation;
|
||||
|
||||
csr.makeResident(graphicsAllocation);
|
||||
auto initialAllocTaskCount = graphicsAllocation.getTaskCount(contextId);
|
||||
auto csrTaskCount = csr.peekTaskCount();
|
||||
EXPECT_EQ(initialAllocTaskCount, csr.peekTaskCount() + 1);
|
||||
|
||||
graphicsAllocation.updateResidencyTaskCount(GraphicsAllocation::objectAlwaysResident, contextId);
|
||||
csr.taskCount = 10;
|
||||
|
||||
csr.makeResident(graphicsAllocation);
|
||||
auto updatedTaskCount = graphicsAllocation.getTaskCount(contextId);
|
||||
csrTaskCount = csr.peekTaskCount();
|
||||
EXPECT_EQ(updatedTaskCount, csr.peekTaskCount() + 1);
|
||||
EXPECT_NE(updatedTaskCount, initialAllocTaskCount);
|
||||
}
|
||||
|
||||
using CommandStreamReceiverHwHeaplessTest = Test<DeviceFixture>;
|
||||
|
||||
HWTEST_F(CommandStreamReceiverHwHeaplessTest, whenHeaplessCommandStreamReceiverFunctionsAreCalledThenExceptionIsThrown) {
|
||||
|
||||
Reference in New Issue
Block a user