mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
Add platform specific getter of debug surface size
For different platforms based on number of available threads and debug surface layout, calculate max debug surface size. Related-To: NEO-6676 Signed-off-by: Jitendra Sharma <jitendra.sharma@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
fec738208a
commit
f52f3df274
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2021 Intel Corporation
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -35,10 +35,6 @@ TEST(Sip, WhenGettingTypeThenCorrectTypeIsReturned) {
|
||||
EXPECT_EQ(SipKernelType::COUNT, undefined.getType());
|
||||
}
|
||||
|
||||
TEST(Sip, givenSipKernelClassWhenAskedForMaxDebugSurfaceSizeThenCorrectValueIsReturned) {
|
||||
EXPECT_EQ(0x1800000u, SipKernel::maxDbgSurfaceSize);
|
||||
}
|
||||
|
||||
TEST(Sip, givenDebuggingInactiveWhenSipTypeIsQueriedThenCsrSipTypeIsReturned) {
|
||||
auto mockDevice = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
|
||||
EXPECT_NE(nullptr, mockDevice);
|
||||
|
||||
@@ -1378,7 +1378,9 @@ HWTEST_F(CommandQueueCommandStreamTest, givenDebugKernelWhenSetupDebugSurfaceIsC
|
||||
kernel->setSshLocal(nullptr, sizeof(RENDER_SURFACE_STATE) + systemThreadSurfaceAddress);
|
||||
auto &commandStreamReceiver = cmdQ.getGpgpuCommandStreamReceiver();
|
||||
|
||||
cmdQ.getGpgpuCommandStreamReceiver().allocateDebugSurface(SipKernel::maxDbgSurfaceSize);
|
||||
auto &hwInfo = *NEO::defaultHwInfo.get();
|
||||
auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily);
|
||||
cmdQ.getGpgpuCommandStreamReceiver().allocateDebugSurface(hwHelper.getSipKernelMaxDbgSurfaceSize(hwInfo));
|
||||
cmdQ.setupDebugSurface(kernel.get());
|
||||
|
||||
auto debugSurface = commandStreamReceiver.getDebugSurfaceAllocation();
|
||||
@@ -1397,7 +1399,9 @@ HWTEST_F(CommandQueueCommandStreamTest, givenCsrWithDebugSurfaceAllocatedWhenSet
|
||||
const auto &systemThreadSurfaceAddress = kernel->getAllocatedKernelInfo()->kernelDescriptor.payloadMappings.implicitArgs.systemThreadSurfaceAddress.bindful;
|
||||
kernel->setSshLocal(nullptr, sizeof(RENDER_SURFACE_STATE) + systemThreadSurfaceAddress);
|
||||
auto &commandStreamReceiver = cmdQ.getGpgpuCommandStreamReceiver();
|
||||
commandStreamReceiver.allocateDebugSurface(SipKernel::maxDbgSurfaceSize);
|
||||
auto hwInfo = *NEO::defaultHwInfo.get();
|
||||
auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily);
|
||||
commandStreamReceiver.allocateDebugSurface(hwHelper.getSipKernelMaxDbgSurfaceSize(hwInfo));
|
||||
auto debugSurface = commandStreamReceiver.getDebugSurfaceAllocation();
|
||||
ASSERT_NE(nullptr, debugSurface);
|
||||
|
||||
|
||||
@@ -175,7 +175,9 @@ HWTEST_F(EnqueueDebugKernelSimpleTest, givenKernelFromProgramWithDebugEnabledWhe
|
||||
std::unique_ptr<MockDebugKernel> kernel(MockKernel::create<MockDebugKernel>(*pDevice, &program));
|
||||
kernel->initialize();
|
||||
std::unique_ptr<MockCommandQueueHwSetupDebugSurface<FamilyType>> mockCmdQ(new MockCommandQueueHwSetupDebugSurface<FamilyType>(context, pClDevice, 0));
|
||||
mockCmdQ->getGpgpuCommandStreamReceiver().allocateDebugSurface(SipKernel::maxDbgSurfaceSize);
|
||||
auto hwInfo = *NEO::defaultHwInfo.get();
|
||||
auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily);
|
||||
mockCmdQ->getGpgpuCommandStreamReceiver().allocateDebugSurface(hwHelper.getSipKernelMaxDbgSurfaceSize(hwInfo));
|
||||
mockCmdQ->setupDebugSurfaceParamsPassed.clear();
|
||||
|
||||
EXPECT_TRUE(isValidOffset(kernel->getKernelInfo().kernelDescriptor.payloadMappings.implicitArgs.systemThreadSurfaceAddress.bindful));
|
||||
|
||||
Reference in New Issue
Block a user