Fix debugSurface allocation for non debug kernels

Change-Id: I253968f7ea617bc68275bec0d6279f1fcf948967
Signed-off-by: Konstanty Misiak <konstanty.misiak@intel.com>
This commit is contained in:
Konstanty Misiak
2020-08-07 11:21:04 +02:00
committed by sys_ocldev
parent 1e7f05e185
commit 7166dfdb05
5 changed files with 22 additions and 6 deletions

View File

@@ -1297,7 +1297,7 @@ struct MockCommandQueueHwWithOverwrittenCsr : public CommandQueueHw<GfxFamily> {
HWTEST_F(CommandQueueHwTest, givenFlushWhenFlushBatchedSubmissionsFailsThenErrorIsRetured) {
MockCommandQueueHwWithOverwrittenCsr<FamilyType> cmdQueue(context, device, nullptr, false);
MockCommandQueueHwWithOverwrittenCsr<FamilyType> cmdQueue(context, pClDevice, nullptr, false);
MockCommandStreamReceiverWithFailingFlushBatchedSubmission csr(*pDevice->executionEnvironment, 0);
cmdQueue.csr = &csr;
cl_int errorCode = cmdQueue.flush();
@@ -1305,7 +1305,7 @@ HWTEST_F(CommandQueueHwTest, givenFlushWhenFlushBatchedSubmissionsFailsThenError
}
HWTEST_F(CommandQueueHwTest, givenFinishWhenFlushBatchedSubmissionsFailsThenErrorIsRetured) {
MockCommandQueueHwWithOverwrittenCsr<FamilyType> cmdQueue(context, device, nullptr, false);
MockCommandQueueHwWithOverwrittenCsr<FamilyType> cmdQueue(context, pClDevice, nullptr, false);
MockCommandStreamReceiverWithFailingFlushBatchedSubmission csr(*pDevice->executionEnvironment, 0);
cmdQueue.csr = &csr;
cl_int errorCode = cmdQueue.finish();

View File

@@ -1035,6 +1035,7 @@ HWTEST_F(CommandQueueCommandStreamTest, givenDebugKernelWhenSetupDebugSurfaceIsC
kernel->getAllocatedKernelInfo()->usesSsh = true;
auto &commandStreamReceiver = cmdQ.getGpgpuCommandStreamReceiver();
cmdQ.getGpgpuCommandStreamReceiver().allocateDebugSurface(SipKernel::maxDbgSurfaceSize);
cmdQ.setupDebugSurface(kernel.get());
auto debugSurface = commandStreamReceiver.getDebugSurfaceAllocation();

View File

@@ -202,4 +202,19 @@ HWTEST_F(EnqueueDebugKernelSimpleTest, givenKernelFromProgramWithoutDebugEnabled
mockCmdQ->enqueueKernel(kernel.get(), 1, nullptr, gws, nullptr, 0, nullptr, nullptr);
::testing::Mock::VerifyAndClearExpectations(mockCmdQ.get());
EXPECT_EQ(nullptr, mockCmdQ->getGpgpuCommandStreamReceiver().getDebugSurfaceAllocation());
}
using ActiveDebuggerTest = EnqueueDebugKernelTest;
HWTEST_F(ActiveDebuggerTest, givenKernelFromProgramWithoutDebugEnabledAndActiveDebuggerWhenEnqueuedThenDebugSurfaceIsSetup) {
MockProgram program(*pDevice->getExecutionEnvironment());
std::unique_ptr<MockDebugKernel> kernel(MockKernel::create<MockDebugKernel>(*pDevice, &program));
kernel->setContext(&context);
std::unique_ptr<CommandQueueHw<FamilyType>> cmdQ(new CommandQueueHw<FamilyType>(&context, pClDevice, nullptr, false));
size_t gws[] = {1, 1, 1};
cmdQ->enqueueKernel(kernel.get(), 1, nullptr, gws, nullptr, 0, nullptr, nullptr);
EXPECT_NE(nullptr, cmdQ->getGpgpuCommandStreamReceiver().getDebugSurfaceAllocation());
}