mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-20 08:53:55 +08:00
[14/n] Internal 4GB allocator
- call make resident on sip kernel allocation. Change-Id: I9c9af5ed4cec3e8b05decac7228658358ef1562b
This commit is contained in:
committed by
sys_ocldev
parent
5eb96ade7a
commit
00ae077913
@@ -306,6 +306,10 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
|
||||
if (preemptionCsrAllocation)
|
||||
makeResident(*preemptionCsrAllocation);
|
||||
|
||||
if (dispatchFlags.preemptionMode == PreemptionMode::MidThread) {
|
||||
makeResident(*BuiltIns::getInstance().getSipKernel(SipKernelType::Csr, *device).getSipAllocation());
|
||||
}
|
||||
|
||||
// If the CSR has work in its CS, flush it before the task
|
||||
bool submitTask = commandStreamStartTask != commandStreamTask.getUsed();
|
||||
bool submitCSR = commandStreamStartCSR != commandStreamCSR.getUsed();
|
||||
|
||||
@@ -330,6 +330,68 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeWhenTaskIsSu
|
||||
EXPECT_EQ(expectedUsedSize, commandStream.getUsed());
|
||||
}
|
||||
|
||||
HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeAndMidThreadPreemptionWhenFlushTaskIsCalledThenSipKernelIsMadeResident) {
|
||||
auto mockCsr = new MockCsrHw2<FamilyType>(*platformDevices[0]);
|
||||
pDevice->resetCommandStreamReceiver(mockCsr);
|
||||
mockCsr->overrideDispatchPolicy(CommandStreamReceiver::DispatchMode::BatchedDispatch);
|
||||
|
||||
auto mockedSubmissionsAggregator = new mockSubmissionsAggregator();
|
||||
mockCsr->overrideSubmissionAggregator(mockedSubmissionsAggregator);
|
||||
|
||||
DispatchFlags dispatchFlags;
|
||||
dispatchFlags.preemptionMode = PreemptionMode::MidThread;
|
||||
|
||||
mockCsr->flushTask(commandStream,
|
||||
0,
|
||||
dsh,
|
||||
ih,
|
||||
ioh,
|
||||
ssh,
|
||||
taskLevel,
|
||||
dispatchFlags);
|
||||
|
||||
auto cmdBuffer = mockedSubmissionsAggregator->peekCommandBuffers().peekHead();
|
||||
auto sipAllocation = BuiltIns::getInstance().getSipKernel(SipKernelType::Csr, *pDevice).getSipAllocation();
|
||||
bool found = false;
|
||||
for (auto allocation : cmdBuffer->surfaces) {
|
||||
if (allocation == sipAllocation) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
EXPECT_TRUE(found);
|
||||
}
|
||||
|
||||
HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInDefaultModeAndMidThreadPreemptionWhenFlushTaskIsCalledThenSipKernelIsMadeResident) {
|
||||
auto mockCsr = new MockCsrHw2<FamilyType>(*platformDevices[0]);
|
||||
pDevice->resetCommandStreamReceiver(mockCsr);
|
||||
|
||||
CommandQueueHw<FamilyType> commandQueue(nullptr, pDevice, 0);
|
||||
auto &commandStream = commandQueue.getCS(4096u);
|
||||
|
||||
DispatchFlags dispatchFlags;
|
||||
dispatchFlags.preemptionMode = PreemptionMode::MidThread;
|
||||
|
||||
mockCsr->flushTask(commandStream,
|
||||
0,
|
||||
dsh,
|
||||
ih,
|
||||
ioh,
|
||||
ssh,
|
||||
taskLevel,
|
||||
dispatchFlags);
|
||||
|
||||
auto sipAllocation = BuiltIns::getInstance().getSipKernel(SipKernelType::Csr, *pDevice).getSipAllocation();
|
||||
bool found = false;
|
||||
for (auto allocation : mockCsr->copyOfAllocations) {
|
||||
if (allocation == sipAllocation) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
EXPECT_TRUE(found);
|
||||
}
|
||||
|
||||
HWTEST_F(CommandStreamReceiverFlushTaskTests, sameTaskLevelShouldntSendAPipeControl) {
|
||||
WhitelistedRegisters forceRegs = {0};
|
||||
pDevice->setForceWhitelistedRegs(true, &forceRegs);
|
||||
|
||||
Reference in New Issue
Block a user