Add sip kernel as hexadecimal array header

Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
Related-To: NEO-5777
This commit is contained in:
Kamil Kopryk
2021-08-29 23:41:42 +00:00
committed by Compute-Runtime-Automation
parent c051495eb8
commit a203cd2863
21 changed files with 230 additions and 21 deletions

View File

@@ -84,8 +84,9 @@ struct OOQueueHwTest : public ClDeviceFixture,
HWTEST_F(CommandQueueHwTest, WhenConstructingTwoCommandQueuesThenOnlyOneDebugSurfaceIsAllocated) {
ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment();
executionEnvironment->rootDeviceEnvironments[0]->debugger.reset(new MockActiveSourceLevelDebugger(new MockOsLibrary));
auto device = std::make_unique<MockClDevice>(MockDevice::create<MockDeviceWithDebuggerActive>(executionEnvironment, 0u));
auto sipType = SipKernel::getSipKernelType(device->getDevice());
SipKernel::initSipKernel(sipType, device->getDevice());
MockCommandQueueHw<FamilyType> mockCmdQueueHw1(context, device.get(), nullptr);

View File

@@ -36,6 +36,9 @@ class EnqueueDebugKernelTest : public ProgramSimpleFixture,
device = pClDevice;
pDevice->executionEnvironment->rootDeviceEnvironments[pDevice->getRootDeviceIndex()]->debugger.reset(new SourceLevelDebugger(nullptr));
auto sipType = SipKernel::getSipKernelType(*pDevice);
SipKernel::initSipKernel(sipType, *pDevice);
if (pDevice->getHardwareInfo().platform.eRenderCoreFamily >= IGFX_GEN9_CORE) {
pDevice->deviceInfo.debuggerActive = true;
std::string filename;

View File

@@ -188,6 +188,8 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInBatchingModeAndMidThread
DispatchFlags dispatchFlags = DispatchFlagsHelper::createDefaultDispatchFlags();
dispatchFlags.preemptionMode = PreemptionMode::MidThread;
auto sipType = SipKernel::getSipKernelType(*pDevice);
SipKernel::initSipKernel(sipType, *pDevice);
mockCsr.flushTask(commandStream,
0,
@@ -219,6 +221,8 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInDefaultModeAndMidThreadP
DispatchFlags dispatchFlags = DispatchFlagsHelper::createDefaultDispatchFlags();
dispatchFlags.preemptionMode = PreemptionMode::MidThread;
auto sipType = SipKernel::getSipKernelType(*pDevice);
SipKernel::initSipKernel(sipType, *pDevice);
mockCsr->flushTask(commandStream,
0,

View File

@@ -1307,6 +1307,30 @@ HWTEST_F(HwHelperTest, whenSetRenderCompressedFlagThenProperFlagSet) {
EXPECT_EQ(0u, gmm->resourceParams.Flags.Info.RenderCompressed);
}
HWTEST_F(HwHelperTest, whenAdjustPreemptionSurfaceSizeIsCalledThenCsrSizeDoesntChange) {
auto &hwHelper = HwHelper::get(renderCoreFamily);
size_t csrSize = 1024;
size_t oldCsrSize = csrSize;
hwHelper.adjustPreemptionSurfaceSize(csrSize);
EXPECT_EQ(oldCsrSize, csrSize);
}
HWTEST_F(HwHelperTest, whenSetSipKernelDataIsCalledThenSipKernelDataDoesntChange) {
auto &hwHelper = HwHelper::get(renderCoreFamily);
uint32_t *sipKernelBinary = nullptr;
uint32_t *oldSipKernelBinary = sipKernelBinary;
size_t kernelBinarySize = 1024;
size_t oldKernelBinarySize = kernelBinarySize;
hwHelper.setSipKernelData(sipKernelBinary, kernelBinarySize);
EXPECT_EQ(oldKernelBinarySize, kernelBinarySize);
EXPECT_EQ(oldSipKernelBinary, sipKernelBinary);
}
HWTEST_F(HwHelperTest, whenIsSipKernelAsHexadecimalArrayPreferredIsCalledThenReturnFalse) {
auto &hwHelper = HwHelper::get(renderCoreFamily);
EXPECT_FALSE(hwHelper.isSipKernelAsHexadecimalArrayPreferred());
}
using isXeHpCoreOrBelow = IsAtMostProduct<IGFX_XE_HP_SDV>;
HWTEST2_F(HwHelperTest, givenXeHPAndBelowPlatformWhenCheckingIfAdditionalPipeControlArgsAreRequiredThenReturnFalse, isXeHpCoreOrBelow) {
const auto &hwHelper = HwHelper::get(renderCoreFamily);

View File

@@ -176,7 +176,11 @@ TEST_F(DeviceFactoryTest, givenPointerToHwInfoWhenGetDevicedCalledThenRequiedSur
ASSERT_TRUE(success);
auto hwInfo = executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo();
EXPECT_EQ(hwInfo->gtSystemInfo.CsrSizeInMb * MemoryConstants::megaByte, hwInfo->capabilityTable.requiredPreemptionSurfaceSize);
const auto &hwHelper = HwHelper::get(hwInfo->platform.eRenderCoreFamily);
auto expextedSize = static_cast<size_t>(hwInfo->gtSystemInfo.CsrSizeInMb * MemoryConstants::megaByte);
hwHelper.adjustPreemptionSurfaceSize(expextedSize);
EXPECT_EQ(expextedSize, hwInfo->capabilityTable.requiredPreemptionSurfaceSize);
}
TEST_F(DeviceFactoryTest, givenCreateMultipleRootDevicesDebugFlagWhenPrepareDeviceEnvironmentsIsCalledThenNumberOfReturnedDevicesIsEqualToDebugVariable) {

View File

@@ -449,7 +449,9 @@ TEST_F(HwInfoConfigTestLinuxDummy, givenPointerToHwInfoWhenConfigureHwInfoCalled
EXPECT_EQ(MemoryConstants::pageSize, pInHwInfo.capabilityTable.requiredPreemptionSurfaceSize);
int ret = hwConfig.configureHwInfoDrm(&pInHwInfo, &outHwInfo, osInterface);
EXPECT_EQ(0, ret);
EXPECT_EQ(outHwInfo.gtSystemInfo.CsrSizeInMb * MemoryConstants::megaByte, outHwInfo.capabilityTable.requiredPreemptionSurfaceSize);
auto expectedSize = static_cast<size_t>(outHwInfo.gtSystemInfo.CsrSizeInMb * MemoryConstants::megaByte);
HwHelper::get(outHwInfo.platform.eRenderCoreFamily).adjustPreemptionSurfaceSize(expectedSize);
EXPECT_EQ(expectedSize, outHwInfo.capabilityTable.requiredPreemptionSurfaceSize);
}
TEST_F(HwInfoConfigTestLinuxDummy, givenInstrumentationForHardwareIsEnabledOrDisabledWhenConfiguringHwInfoThenOverrideItUsingHaveInstrumentation) {

View File

@@ -22,6 +22,8 @@
HWTEST_F(CommandStreamReceiverWithActiveDebuggerTest, givenCsrWithActiveDebuggerAndDisabledPreemptionWhenFlushTaskIsCalledThenSipKernelIsMadeResident) {
auto mockCsr = createCSR<FamilyType>();
auto sipType = SipKernel::getSipKernelType(device->getDevice());
SipKernel::initSipKernel(sipType, device->getDevice());
CommandQueueHw<FamilyType> commandQueue(nullptr, device.get(), 0, false);
auto &commandStream = commandQueue.getCS(4096u);