From 5510dc7daa1b0e656cd3d754c9500f56cca836cd Mon Sep 17 00:00:00 2001 From: Bartosz Dunajski Date: Fri, 10 Jun 2022 11:52:43 +0000 Subject: [PATCH] Add adjustHwInfoForIgc support Signed-off-by: Bartosz Dunajski --- level_zero/core/source/module/module_imp.cpp | 6 +++-- .../unit_tests/sources/module/test_module.cpp | 26 +++++++++++++------ manifests/manifest.yml | 2 +- opencl/source/program/program.cpp | 6 ++++- .../test/unit_test/program/program_tests.cpp | 10 +++++-- .../source/ocloc_igc_facade.cpp | 9 +++++-- .../compiler_interface/compiler_interface.cpp | 7 +++-- .../source/helpers/compiler_hw_info_config.h | 2 ++ .../helpers/compiler_hw_info_config_base.inl | 4 +++ .../compiler_interface_tests.cpp | 17 ++++++++---- .../device_binary_format/elf/elf_tests_data.h | 6 ++++- .../patchtokens_dumper_tests.cpp | 19 +++++++++++--- .../device_binary_format/patchtokens_tests.h | 7 ++++- 13 files changed, 93 insertions(+), 28 deletions(-) diff --git a/level_zero/core/source/module/module_imp.cpp b/level_zero/core/source/module/module_imp.cpp index ce9e65029a..e95f732c9d 100644 --- a/level_zero/core/source/module/module_imp.cpp +++ b/level_zero/core/source/module/module_imp.cpp @@ -248,8 +248,10 @@ bool ModuleTranslationUnit::createFromNativeBinary(const char *input, size_t inp UNRECOVERABLE_IF((nullptr == device) || (nullptr == device->getNEODevice())); auto productAbbreviation = NEO::hardwarePrefix[device->getNEODevice()->getHardwareInfo().platform.eProductFamily]; - const auto &hwInfo = device->getNEODevice()->getHardwareInfo(); - NEO::TargetDevice targetDevice = NEO::targetDeviceFromHwInfo(hwInfo); + auto copyHwInfo = device->getNEODevice()->getHardwareInfo(); + NEO::CompilerHwInfoConfig::get(copyHwInfo.platform.eProductFamily)->adjustHwInfoForIgc(copyHwInfo); + + NEO::TargetDevice targetDevice = NEO::targetDeviceFromHwInfo(copyHwInfo); std::string decodeErrors; std::string decodeWarnings; ArrayRef archive(reinterpret_cast(input), inputSize); diff --git a/level_zero/core/test/unit_tests/sources/module/test_module.cpp b/level_zero/core/test/unit_tests/sources/module/test_module.cpp index dd668c38b9..b3bc3c0f6b 100644 --- a/level_zero/core/test/unit_tests/sources/module/test_module.cpp +++ b/level_zero/core/test/unit_tests/sources/module/test_module.cpp @@ -2016,14 +2016,16 @@ HWTEST_F(ModuleTranslationUnitTest, GivenRebuildFlagWhenCreatingModuleFromNative HWTEST_F(ModuleTranslationUnitTest, WhenCreatingFromNativeBinaryThenSetsUpRequiredTargetProductProperly) { ZebinTestData::ValidEmptyProgram emptyProgram; - auto hwInfo = device->getNEODevice()->getHardwareInfo(); - emptyProgram.elfHeader->machine = hwInfo.platform.eProductFamily; + NEO::HardwareInfo copyHwInfo = device->getNEODevice()->getHardwareInfo(); + NEO::CompilerHwInfoConfig::get(copyHwInfo.platform.eProductFamily)->adjustHwInfoForIgc(copyHwInfo); + + emptyProgram.elfHeader->machine = copyHwInfo.platform.eProductFamily; L0::ModuleTranslationUnit moduleTuValid(this->device); bool success = moduleTuValid.createFromNativeBinary(reinterpret_cast(emptyProgram.storage.data()), emptyProgram.storage.size()); EXPECT_TRUE(success); - emptyProgram.elfHeader->machine = hwInfo.platform.eProductFamily; + emptyProgram.elfHeader->machine = copyHwInfo.platform.eProductFamily; ++emptyProgram.elfHeader->machine; L0::ModuleTranslationUnit moduleTuInvalid(this->device); success = moduleTuInvalid.createFromNativeBinary(reinterpret_cast(emptyProgram.storage.data()), emptyProgram.storage.size()); @@ -2062,9 +2064,11 @@ HWTEST_F(ModuleTranslationUnitTest, WhenCreatingFromNativeBinaryThenSetsUpPacked HWTEST_F(ModuleTranslationUnitTest, WhenCreatingFromZebinThenAppendAllowZebinFlagToBuildOptions) { ZebinTestData::ValidEmptyProgram zebin; - auto hwInfo = device->getNEODevice()->getHardwareInfo(); - zebin.elfHeader->machine = hwInfo.platform.eProductFamily; + NEO::HardwareInfo copyHwInfo = device->getNEODevice()->getHardwareInfo(); + NEO::CompilerHwInfoConfig::get(copyHwInfo.platform.eProductFamily)->adjustHwInfoForIgc(copyHwInfo); + + zebin.elfHeader->machine = copyHwInfo.platform.eProductFamily; L0::ModuleTranslationUnit moduleTu(this->device); bool success = moduleTu.createFromNativeBinary(reinterpret_cast(zebin.storage.data()), zebin.storage.size()); EXPECT_TRUE(success); @@ -2089,8 +2093,10 @@ kernels: zebin.appendSection(NEO::Elf::SHT_PROGBITS, NEO::Elf::SectionsNamesZebin::textPrefix.str() + "some_kernel", {}); zebin.appendSection(NEO::Elf::SHT_PROGBITS, NEO::Elf::SectionsNamesZebin::textPrefix.str() + "some_other_kernel", {}); - auto hwInfo = device->getNEODevice()->getHardwareInfo(); - zebin.elfHeader->machine = hwInfo.platform.eProductFamily; + NEO::HardwareInfo copyHwInfo = device->getNEODevice()->getHardwareInfo(); + NEO::CompilerHwInfoConfig::get(copyHwInfo.platform.eProductFamily)->adjustHwInfoForIgc(copyHwInfo); + + zebin.elfHeader->machine = copyHwInfo.platform.eProductFamily; L0::ModuleTranslationUnit moduleTuValid(this->device); bool success = moduleTuValid.createFromNativeBinary(reinterpret_cast(zebin.storage.data()), zebin.storage.size()); @@ -2932,7 +2938,11 @@ TEST_F(ModuleWithZebinTest, givenNonZebinaryFormatWhenGettingDebugInfoThenDebugZ HWTEST_F(ModuleWithZebinTest, givenZebinWithKernelCallingExternalFunctionThenUpdateKernelsBarrierCount) { ZebinTestData::ZebinWithExternalFunctionsInfo zebin; - zebin.setProductFamily(static_cast(device->getHwInfo().platform.eProductFamily)); + + NEO::HardwareInfo copyHwInfo = device->getHwInfo(); + NEO::CompilerHwInfoConfig::get(copyHwInfo.platform.eProductFamily)->adjustHwInfoForIgc(copyHwInfo); + + zebin.setProductFamily(static_cast(copyHwInfo.platform.eProductFamily)); ze_module_desc_t moduleDesc = {}; moduleDesc.format = ZE_MODULE_FORMAT_NATIVE; diff --git a/manifests/manifest.yml b/manifests/manifest.yml index cc4c7858e3..99a5c53a83 100644 --- a/manifests/manifest.yml +++ b/manifests/manifest.yml @@ -31,7 +31,7 @@ components: dest_dir: kernels_bin type: git branch: kernels_bin - revision: 1906-181 + revision: 1906-184 kmdaf: branch: kmdaf dest_dir: kmdaf diff --git a/opencl/source/program/program.cpp b/opencl/source/program/program.cpp index 649f727235..4fb715d03f 100644 --- a/opencl/source/program/program.cpp +++ b/opencl/source/program/program.cpp @@ -165,7 +165,11 @@ cl_int Program::createProgramFromBinary( auto hwInfo = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo(); auto productAbbreviation = hardwarePrefix[hwInfo->platform.eProductFamily]; - TargetDevice targetDevice = targetDeviceFromHwInfo(*hwInfo); + + auto copyHwInfo = *hwInfo; + CompilerHwInfoConfig::get(copyHwInfo.platform.eProductFamily)->adjustHwInfoForIgc(copyHwInfo); + + TargetDevice targetDevice = targetDeviceFromHwInfo(copyHwInfo); std::string decodeErrors; std::string decodeWarnings; auto singleDeviceBinary = unpackSingleDeviceBinary(archive, ConstStringRef(productAbbreviation, strlen(productAbbreviation)), targetDevice, diff --git a/opencl/test/unit_test/program/program_tests.cpp b/opencl/test/unit_test/program/program_tests.cpp index 03762e2fa8..7ef6f96f3e 100644 --- a/opencl/test/unit_test/program/program_tests.cpp +++ b/opencl/test/unit_test/program/program_tests.cpp @@ -1665,7 +1665,10 @@ TEST_F(ProgramWithDebugSymbolsTests, GivenProgramCreatedWithDashGOptionWhenGetti ArrayRef archive(reinterpret_cast(testBinary.get()), size); auto productAbbreviation = hardwarePrefix[pDevice->getHardwareInfo().platform.eProductFamily]; - TargetDevice targetDevice = NEO::targetDeviceFromHwInfo(pDevice->getHardwareInfo()); + HardwareInfo copyHwInfo = pDevice->getHardwareInfo(); + NEO::CompilerHwInfoConfig::get(copyHwInfo.platform.eProductFamily)->adjustHwInfoForIgc(copyHwInfo); + + TargetDevice targetDevice = NEO::targetDeviceFromHwInfo(copyHwInfo); std::string decodeErrors; std::string decodeWarnings; @@ -2076,8 +2079,11 @@ TEST_F(ProgramTests, whenCreatingFromZebinThenAppendAllowZebinFlagToBuildOptions GTEST_SKIP(); } + auto copyHwInfo = *defaultHwInfo; + CompilerHwInfoConfig::get(copyHwInfo.platform.eProductFamily)->adjustHwInfoForIgc(copyHwInfo); + ZebinTestData::ValidEmptyProgram zebin; - zebin.elfHeader->machine = defaultHwInfo->platform.eProductFamily; + zebin.elfHeader->machine = copyHwInfo.platform.eProductFamily; auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(nullptr, mockRootDeviceIndex)); auto program = std::make_unique(toClDeviceVector(*device)); diff --git a/shared/offline_compiler/source/ocloc_igc_facade.cpp b/shared/offline_compiler/source/ocloc_igc_facade.cpp index 22f603b10d..32efa729a8 100644 --- a/shared/offline_compiler/source/ocloc_igc_facade.cpp +++ b/shared/offline_compiler/source/ocloc_igc_facade.cpp @@ -80,8 +80,13 @@ int OclocIgcFacade::initialize(const HardwareInfo &hwInfo) { const auto compilerHwInfoConfig = CompilerHwInfoConfig::get(hwInfo.platform.eProductFamily); - IGC::PlatformHelper::PopulateInterfaceWith(*igcPlatform.get(), hwInfo.platform); - IGC::GtSysInfoHelper::PopulateInterfaceWith(*igcGtSystemInfo.get(), hwInfo.gtSystemInfo); + auto copyHwInfo = hwInfo; + if (compilerHwInfoConfig) { + compilerHwInfoConfig->adjustHwInfoForIgc(copyHwInfo); + } + + IGC::PlatformHelper::PopulateInterfaceWith(*igcPlatform.get(), copyHwInfo.platform); + IGC::GtSysInfoHelper::PopulateInterfaceWith(*igcGtSystemInfo.get(), copyHwInfo.gtSystemInfo); populateWithFeatures(igcFtrWa.get(), hwInfo, compilerHwInfoConfig); diff --git a/shared/source/compiler_interface/compiler_interface.cpp b/shared/source/compiler_interface/compiler_interface.cpp index 4a5bf61183..387863141a 100644 --- a/shared/source/compiler_interface/compiler_interface.cpp +++ b/shared/source/compiler_interface/compiler_interface.cpp @@ -436,8 +436,11 @@ IGC::IgcOclDeviceCtxTagOCL *CompilerInterface::getIgcDeviceCtx(const Device &dev getHwInfoForPlatformString(productFamily, hwInfo); } - IGC::PlatformHelper::PopulateInterfaceWith(*igcPlatform, hwInfo->platform); - IGC::GtSysInfoHelper::PopulateInterfaceWith(*igcGtSystemInfo, hwInfo->gtSystemInfo); + auto copyHwInfo = *hwInfo; + CompilerHwInfoConfig::get(copyHwInfo.platform.eProductFamily)->adjustHwInfoForIgc(copyHwInfo); + + IGC::PlatformHelper::PopulateInterfaceWith(*igcPlatform, copyHwInfo.platform); + IGC::GtSysInfoHelper::PopulateInterfaceWith(*igcGtSystemInfo, copyHwInfo.gtSystemInfo); igcFtrWa->SetFtrDesktop(device.getHardwareInfo().featureTable.flags.ftrDesktop); igcFtrWa->SetFtrChannelSwizzlingXOREnabled(device.getHardwareInfo().featureTable.flags.ftrChannelSwizzlingXOREnabled); diff --git a/shared/source/helpers/compiler_hw_info_config.h b/shared/source/helpers/compiler_hw_info_config.h index c387bb904d..661d6e270d 100644 --- a/shared/source/helpers/compiler_hw_info_config.h +++ b/shared/source/helpers/compiler_hw_info_config.h @@ -27,6 +27,7 @@ class CompilerHwInfoConfig { virtual bool isForceEmuInt32DivRemSPRequired() const = 0; virtual bool isStatelessToStatefulBufferOffsetSupported() const = 0; virtual bool isForceToStatelessRequired() const = 0; + virtual void adjustHwInfoForIgc(HardwareInfo &hwInfo) const = 0; }; template @@ -41,6 +42,7 @@ class CompilerHwInfoConfigHw : public CompilerHwInfoConfig { bool isForceEmuInt32DivRemSPRequired() const override; bool isStatelessToStatefulBufferOffsetSupported() const override; bool isForceToStatelessRequired() const override; + void adjustHwInfoForIgc(HardwareInfo &hwInfo) const override; protected: CompilerHwInfoConfigHw() = default; diff --git a/shared/source/helpers/compiler_hw_info_config_base.inl b/shared/source/helpers/compiler_hw_info_config_base.inl index 5b00acba3e..082b967feb 100644 --- a/shared/source/helpers/compiler_hw_info_config_base.inl +++ b/shared/source/helpers/compiler_hw_info_config_base.inl @@ -20,4 +20,8 @@ bool CompilerHwInfoConfigHw::isStatelessToStatefulBufferOffsetSuppor return true; } +template +void CompilerHwInfoConfigHw::adjustHwInfoForIgc(HardwareInfo &hwInfo) const { +} + } // namespace NEO diff --git a/shared/test/unit_test/compiler_interface/compiler_interface_tests.cpp b/shared/test/unit_test/compiler_interface/compiler_interface_tests.cpp index b7ca2469ef..9f2345de71 100644 --- a/shared/test/unit_test/compiler_interface/compiler_interface_tests.cpp +++ b/shared/test/unit_test/compiler_interface/compiler_interface_tests.cpp @@ -7,6 +7,7 @@ #include "shared/source/compiler_interface/compiler_interface.h" #include "shared/source/compiler_interface/compiler_interface.inl" +#include "shared/source/helpers/compiler_hw_info_config.h" #include "shared/source/helpers/file_io.h" #include "shared/source/helpers/hw_info.h" #include "shared/test/common/fixtures/device_fixture.h" @@ -880,8 +881,12 @@ HWTEST_F(CompilerInterfaceTest, givenNoDbgKeyForceUseDifferentPlatformWhenReques IGC::IgcOclDeviceCtxTagOCL *devCtx = pCompilerInterface->peekIgcDeviceCtx(device); auto igcPlatform = devCtx->GetPlatformHandle(); auto igcSysInfo = devCtx->GetGTSystemInfoHandle(); - EXPECT_EQ(device->getHardwareInfo().platform.eProductFamily, igcPlatform->GetProductFamily()); - EXPECT_EQ(device->getHardwareInfo().platform.eRenderCoreFamily, igcPlatform->GetRenderCoreFamily()); + + HardwareInfo copyHwInfo = device->getHardwareInfo(); + NEO::CompilerHwInfoConfig::get(copyHwInfo.platform.eProductFamily)->adjustHwInfoForIgc(copyHwInfo); + + EXPECT_EQ(copyHwInfo.platform.eProductFamily, igcPlatform->GetProductFamily()); + EXPECT_EQ(copyHwInfo.platform.eRenderCoreFamily, igcPlatform->GetRenderCoreFamily()); EXPECT_EQ(device->getHardwareInfo().gtSystemInfo.SliceCount, igcSysInfo->GetSliceCount()); EXPECT_EQ(device->getHardwareInfo().gtSystemInfo.SubSliceCount, igcSysInfo->GetSubSliceCount()); EXPECT_EQ(device->getHardwareInfo().gtSystemInfo.EUCount, igcSysInfo->GetEUCount()); @@ -892,7 +897,6 @@ HWTEST_F(CompilerInterfaceTest, givenDbgKeyForceUseDifferentPlatformWhenRequestF DebugManagerStateRestore dbgRestore; auto dbgProdFamily = DEFAULT_TEST_PLATFORM::hwInfo.platform.eProductFamily; std::string dbgPlatformString(hardwarePrefix[dbgProdFamily]); - const PLATFORM dbgPlatform = hardwareInfoTable[dbgProdFamily]->platform; const GT_SYSTEM_INFO dbgSystemInfo = hardwareInfoTable[dbgProdFamily]->gtSystemInfo; DebugManager.flags.ForceCompilerUsePlatform.set(dbgPlatformString); @@ -903,8 +907,11 @@ HWTEST_F(CompilerInterfaceTest, givenDbgKeyForceUseDifferentPlatformWhenRequestF auto igcPlatform = devCtx->GetPlatformHandle(); auto igcSysInfo = devCtx->GetGTSystemInfoHandle(); - EXPECT_EQ(dbgPlatform.eProductFamily, igcPlatform->GetProductFamily()); - EXPECT_EQ(dbgPlatform.eRenderCoreFamily, igcPlatform->GetRenderCoreFamily()); + HardwareInfo copyHwInfo = *hardwareInfoTable[dbgProdFamily]; + NEO::CompilerHwInfoConfig::get(copyHwInfo.platform.eProductFamily)->adjustHwInfoForIgc(copyHwInfo); + + EXPECT_EQ(copyHwInfo.platform.eProductFamily, igcPlatform->GetProductFamily()); + EXPECT_EQ(copyHwInfo.platform.eRenderCoreFamily, igcPlatform->GetRenderCoreFamily()); EXPECT_EQ(dbgSystemInfo.SliceCount, igcSysInfo->GetSliceCount()); EXPECT_EQ(dbgSystemInfo.SubSliceCount, igcSysInfo->GetSubSliceCount()); EXPECT_EQ(dbgSystemInfo.DualSubSliceCount, igcSysInfo->GetSubSliceCount()); diff --git a/shared/test/unit_test/device_binary_format/elf/elf_tests_data.h b/shared/test/unit_test/device_binary_format/elf/elf_tests_data.h index 1952c6b2e0..e71c46241e 100644 --- a/shared/test/unit_test/device_binary_format/elf/elf_tests_data.h +++ b/shared/test/unit_test/device_binary_format/elf/elf_tests_data.h @@ -10,6 +10,7 @@ #include "shared/source/compiler_interface/intermediate_representations.h" #include "shared/source/device_binary_format/elf/elf_encoder.h" #include "shared/source/device_binary_format/elf/ocl_elf.h" +#include "shared/source/helpers/compiler_hw_info_config.h" #include "patch_list.h" @@ -25,7 +26,10 @@ template struct MockElfBinaryPatchtokens { MockElfBinaryPatchtokens(const HardwareInfo &hwInfo) : MockElfBinaryPatchtokens(std::string{}, hwInfo){}; MockElfBinaryPatchtokens(const std::string &buildOptions, const HardwareInfo &hwInfo) { - mockDevBinaryHeader.Device = hwInfo.platform.eRenderCoreFamily; + auto copyHwInfo = hwInfo; + CompilerHwInfoConfig::get(copyHwInfo.platform.eProductFamily)->adjustHwInfoForIgc(copyHwInfo); + + mockDevBinaryHeader.Device = copyHwInfo.platform.eRenderCoreFamily; mockDevBinaryHeader.GPUPointerSizeInBytes = sizeof(void *); mockDevBinaryHeader.Version = iOpenCL::CURRENT_ICBE_VERSION; constexpr size_t mockDevBinaryDataSize = sizeof(mockDevBinaryHeader) + mockDataSize; diff --git a/shared/test/unit_test/device_binary_format/patchtokens_dumper_tests.cpp b/shared/test/unit_test/device_binary_format/patchtokens_dumper_tests.cpp index 0e936bee56..60ca51c01e 100644 --- a/shared/test/unit_test/device_binary_format/patchtokens_dumper_tests.cpp +++ b/shared/test/unit_test/device_binary_format/patchtokens_dumper_tests.cpp @@ -7,6 +7,8 @@ #include "shared/source/device_binary_format/patchtokens_decoder.h" #include "shared/source/device_binary_format/patchtokens_dumper.h" +#include "shared/source/helpers/compiler_hw_info_config.h" +#include "shared/test/common/helpers/default_hw_info.h" #include "shared/test/common/test_macros/test.h" #include "shared/test/unit_test/device_binary_format/patchtokens_tests.h" @@ -125,6 +127,9 @@ TEST(ProgramDumper, GivenProgramWithPatchtokensThenProperlyCreatesDump) { unknownToken1.Token = NUM_PATCH_TOKENS; progWithConst.unhandledTokens.push_back(&unknownToken1); + NEO::HardwareInfo copyHwInfo = *NEO::defaultHwInfo; + NEO::CompilerHwInfoConfig::get(copyHwInfo.platform.eProductFamily)->adjustHwInfoForIgc(copyHwInfo); + std::string generated = NEO::PatchTokenBinary::asString(progWithConst); std::stringstream expected; expected << R"===(Program of size : )===" << progWithConst.blobs.programInfo.size() << R"===( decoded successfully @@ -134,7 +139,7 @@ struct SProgramBinaryHeader { << CURRENT_ICBE_VERSION << R"===( uint32_t Device; // = )===" - << renderCoreFamily << R"===( + << copyHwInfo.platform.eRenderCoreFamily << R"===( uint32_t GPUPointerSizeInBytes; // = )===" << progWithConst.header->GPUPointerSizeInBytes << R"===( @@ -265,6 +270,10 @@ TEST(ProgramDumper, GivenProgramWithKernelThenProperlyCreatesDump) { PatchTokensTestData::ValidProgramWithKernelUsingSlm program; std::string generated = NEO::PatchTokenBinary::asString(program); std::stringstream expected; + + NEO::HardwareInfo copyHwInfo = *NEO::defaultHwInfo; + NEO::CompilerHwInfoConfig::get(copyHwInfo.platform.eProductFamily)->adjustHwInfoForIgc(copyHwInfo); + expected << R"===(Program of size : )===" << program.blobs.programInfo.size() << R"===( decoded successfully struct SProgramBinaryHeader { uint32_t Magic; // = 1229870147 @@ -272,7 +281,7 @@ struct SProgramBinaryHeader { << iOpenCL::CURRENT_ICBE_VERSION << R"===( uint32_t Device; // = )===" - << renderCoreFamily << R"===( + << copyHwInfo.platform.eRenderCoreFamily << R"===( uint32_t GPUPointerSizeInBytes; // = )===" << program.header->GPUPointerSizeInBytes << R"===( @@ -347,6 +356,10 @@ TEST(ProgramDumper, GivenProgramWithMultipleKerneslThenProperlyCreatesDump) { program.kernels[2].name = ArrayRef(); std::string generated = NEO::PatchTokenBinary::asString(program); std::stringstream expected; + + NEO::HardwareInfo copyHwInfo = *NEO::defaultHwInfo; + NEO::CompilerHwInfoConfig::get(copyHwInfo.platform.eProductFamily)->adjustHwInfoForIgc(copyHwInfo); + expected << R"===(Program of size : )===" << program.blobs.programInfo.size() << R"===( decoded successfully struct SProgramBinaryHeader { uint32_t Magic; // = 1229870147 @@ -354,7 +367,7 @@ struct SProgramBinaryHeader { << iOpenCL::CURRENT_ICBE_VERSION << R"===( uint32_t Device; // = )===" - << renderCoreFamily << R"===( + << copyHwInfo.platform.eRenderCoreFamily << R"===( uint32_t GPUPointerSizeInBytes; // = )===" << program.header->GPUPointerSizeInBytes << R"===( diff --git a/shared/test/unit_test/device_binary_format/patchtokens_tests.h b/shared/test/unit_test/device_binary_format/patchtokens_tests.h index f76635c205..3084f1fcf5 100644 --- a/shared/test/unit_test/device_binary_format/patchtokens_tests.h +++ b/shared/test/unit_test/device_binary_format/patchtokens_tests.h @@ -9,7 +9,9 @@ #include "shared/source/device_binary_format/patchtokens_decoder.h" #include "shared/source/helpers/api_specific_config.h" +#include "shared/source/helpers/compiler_hw_info_config.h" #include "shared/source/helpers/string.h" +#include "shared/test/common/helpers/default_hw_info.h" #include "igfxfmid.h" @@ -81,10 +83,13 @@ inline uint32_t pushBackArgInfoToken(std::vector &outStream, struct ValidEmptyProgram : NEO::PatchTokenBinary::ProgramFromPatchtokens { ValidEmptyProgram() { + auto copyHwInfo = *NEO::defaultHwInfo; + NEO::CompilerHwInfoConfig::get(copyHwInfo.platform.eProductFamily)->adjustHwInfoForIgc(copyHwInfo); + iOpenCL::SProgramBinaryHeader headerTok = {}; headerTok.Magic = iOpenCL::MAGIC_CL; headerTok.Version = iOpenCL::CURRENT_ICBE_VERSION; - headerTok.Device = renderCoreFamily; + headerTok.Device = copyHwInfo.platform.eRenderCoreFamily; headerTok.GPUPointerSizeInBytes = sizeof(uintptr_t); this->decodeStatus = NEO::DecodeError::Success;