mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-10 12:53:42 +08:00
Stop accessing task count from out-of-bound in opencl and shared ult
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
7c068cb05b
commit
817ba40771
@ -30,8 +30,6 @@ struct UltCommandStreamReceiverTest
|
||||
ClDeviceFixture::SetUp();
|
||||
ClHardwareParse::SetUp();
|
||||
|
||||
size_t sizeStream = 512;
|
||||
size_t alignmentStream = 0x1000;
|
||||
cmdBuffer = alignedMalloc(sizeStream, alignmentStream);
|
||||
dshBuffer = alignedMalloc(sizeStream, alignmentStream);
|
||||
iohBuffer = alignedMalloc(sizeStream, alignmentStream);
|
||||
@ -42,6 +40,14 @@ struct UltCommandStreamReceiverTest
|
||||
ASSERT_NE(nullptr, iohBuffer);
|
||||
ASSERT_NE(nullptr, sshBuffer);
|
||||
|
||||
initHeaps();
|
||||
|
||||
flushTaskFlags.threadArbitrationPolicy = NEO::HwHelper::get(hardwareInfo.platform.eRenderCoreFamily).getDefaultThreadArbitrationPolicy();
|
||||
|
||||
pDevice->getGpgpuCommandStreamReceiver().setupContext(*pDevice->getDefaultEngine().osContext);
|
||||
}
|
||||
|
||||
void initHeaps() {
|
||||
commandStream.replaceBuffer(cmdBuffer, sizeStream);
|
||||
auto graphicsAllocation = new MockGraphicsAllocation(cmdBuffer, sizeStream);
|
||||
commandStream.replaceGraphicsAllocation(graphicsAllocation);
|
||||
@ -58,18 +64,18 @@ struct UltCommandStreamReceiverTest
|
||||
ssh.replaceBuffer(sshBuffer, sizeStream);
|
||||
graphicsAllocation = new MockGraphicsAllocation(sshBuffer, sizeStream);
|
||||
ssh.replaceGraphicsAllocation(graphicsAllocation);
|
||||
|
||||
flushTaskFlags.threadArbitrationPolicy = NEO::HwHelper::get(hardwareInfo.platform.eRenderCoreFamily).getDefaultThreadArbitrationPolicy();
|
||||
|
||||
pDevice->getGpgpuCommandStreamReceiver().setupContext(*pDevice->getDefaultEngine().osContext);
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
pDevice->getGpgpuCommandStreamReceiver().flushBatchedSubmissions();
|
||||
void cleanupHeaps() {
|
||||
delete dsh.getGraphicsAllocation();
|
||||
delete ioh.getGraphicsAllocation();
|
||||
delete ssh.getGraphicsAllocation();
|
||||
delete commandStream.getGraphicsAllocation();
|
||||
}
|
||||
|
||||
void TearDown() override {
|
||||
pDevice->getGpgpuCommandStreamReceiver().flushBatchedSubmissions();
|
||||
cleanupHeaps();
|
||||
|
||||
alignedFree(sshBuffer);
|
||||
alignedFree(iohBuffer);
|
||||
@ -167,5 +173,8 @@ struct UltCommandStreamReceiverTest
|
||||
uint32_t latestSentDcFlushTaskCount;
|
||||
uint32_t latestSentNonDcFlushTaskCount;
|
||||
uint32_t dcFlushRequiredTaskCount;
|
||||
|
||||
const size_t sizeStream = 512;
|
||||
const size_t alignmentStream = 0x1000;
|
||||
};
|
||||
} // namespace NEO
|
||||
|
Reference in New Issue
Block a user