From 5f908ce092ca8b2dae7789c4ca63aa6391f5d124 Mon Sep 17 00:00:00 2001 From: "Chodor, Jaroslaw" Date: Mon, 14 Oct 2024 18:23:13 +0000 Subject: [PATCH] feature: adding support for custom compiler backends This adds abbility to load different versions of the backend compiler based on underlying device. Related-To: NEO-12747 Signed-off-by: Chodor, Jaroslaw --- .../mock/mock_ocloc_igc_facade.cpp | 4 +- .../mock/mock_ocloc_igc_facade.h | 2 +- .../source/ocloc_igc_facade.cpp | 10 +- .../source/ocloc_igc_facade.h | 2 +- .../compiler_interface/compiler_interface.cpp | 269 ++++++---- .../compiler_interface/compiler_interface.h | 93 +++- .../debug_settings/debug_variables_base.inl | 2 + .../source/helpers/compiler_product_helper.h | 4 + .../helpers/compiler_product_helper_base.inl | 12 + .../common/mocks/mock_compiler_interface.h | 54 +- .../mocks/mock_compiler_product_helper.h | 3 +- shared/test/common/test_files/igdrcl.config | 2 + .../compiler_interface_tests.cpp | 482 ++++++------------ 13 files changed, 479 insertions(+), 460 deletions(-) diff --git a/opencl/test/unit_test/offline_compiler/mock/mock_ocloc_igc_facade.cpp b/opencl/test/unit_test/offline_compiler/mock/mock_ocloc_igc_facade.cpp index 0b19fd742f..cf4f8f3396 100644 --- a/opencl/test/unit_test/offline_compiler/mock/mock_ocloc_igc_facade.cpp +++ b/opencl/test/unit_test/offline_compiler/mock/mock_ocloc_igc_facade.cpp @@ -14,11 +14,11 @@ namespace NEO { MockOclocIgcFacade::MockOclocIgcFacade(OclocArgHelper *argHelper) : OclocIgcFacade(argHelper){}; MockOclocIgcFacade::~MockOclocIgcFacade() = default; -std::unique_ptr MockOclocIgcFacade::loadIgcLibrary() const { +std::unique_ptr MockOclocIgcFacade::loadIgcLibrary(const char *libName) const { if (shouldFailLoadingOfIgcLib) { return nullptr; } else { - return OclocIgcFacade::loadIgcLibrary(); + return OclocIgcFacade::loadIgcLibrary(libName); } } diff --git a/opencl/test/unit_test/offline_compiler/mock/mock_ocloc_igc_facade.h b/opencl/test/unit_test/offline_compiler/mock/mock_ocloc_igc_facade.h index 6157f2ea85..3d892c1aff 100644 --- a/opencl/test/unit_test/offline_compiler/mock/mock_ocloc_igc_facade.h +++ b/opencl/test/unit_test/offline_compiler/mock/mock_ocloc_igc_facade.h @@ -33,7 +33,7 @@ class MockOclocIgcFacade : public OclocIgcFacade { MockOclocIgcFacade(OclocArgHelper *argHelper); ~MockOclocIgcFacade() override; - std::unique_ptr loadIgcLibrary() const override; + std::unique_ptr loadIgcLibrary(const char *libName) const override; CIF::CreateCIFMainFunc_t loadCreateIgcMainFunction() const override; diff --git a/shared/offline_compiler/source/ocloc_igc_facade.cpp b/shared/offline_compiler/source/ocloc_igc_facade.cpp index 4221385326..77e3b96f1d 100644 --- a/shared/offline_compiler/source/ocloc_igc_facade.cpp +++ b/shared/offline_compiler/source/ocloc_igc_facade.cpp @@ -37,7 +37,9 @@ int OclocIgcFacade::initialize(const HardwareInfo &hwInfo) { return OCLOC_SUCCESS; } - igcLib = loadIgcLibrary(); + auto compilerProductHelper = NEO::CompilerProductHelper::create(hwInfo.platform.eProductFamily); + + igcLib = loadIgcLibrary(compilerProductHelper ? compilerProductHelper->getCustomIgcLibraryName() : nullptr); if (!igcLib) { argHelper->printf("Error! Loading of IGC library has failed! Filename: %s\n", Os::igcDllName); return OCLOC_OUT_OF_HOST_MEMORY; @@ -100,7 +102,6 @@ int OclocIgcFacade::initialize(const HardwareInfo &hwInfo) { argHelper->printf("Error! IGC device context has not been properly created!\n"); return OCLOC_OUT_OF_HOST_MEMORY; } - auto compilerProductHelper = NEO::CompilerProductHelper::create(hwInfo.platform.eProductFamily); populateIgcPlatform(*igcPlatform, hwInfo); IGC::GtSysInfoHelper::PopulateInterfaceWith(*igcGtSystemInfo.get(), hwInfo.gtSystemInfo); @@ -111,8 +112,9 @@ int OclocIgcFacade::initialize(const HardwareInfo &hwInfo) { return OCLOC_SUCCESS; } -std::unique_ptr OclocIgcFacade::loadIgcLibrary() const { - return std::unique_ptr{OsLibrary::loadFunc({Os::igcDllName})}; +std::unique_ptr OclocIgcFacade::loadIgcLibrary(const char *libName) const { + auto effectiveLibName = libName ? libName : Os::igcDllName; + return std::unique_ptr{OsLibrary::loadFunc({effectiveLibName})}; } CIF::CreateCIFMainFunc_t OclocIgcFacade::loadCreateIgcMainFunction() const { diff --git a/shared/offline_compiler/source/ocloc_igc_facade.h b/shared/offline_compiler/source/ocloc_igc_facade.h index f97aac51a1..edb2b8faa2 100644 --- a/shared/offline_compiler/source/ocloc_igc_facade.h +++ b/shared/offline_compiler/source/ocloc_igc_facade.h @@ -43,7 +43,7 @@ class OclocIgcFacade { CIF::RAII::UPtr_t createTranslationContext(IGC::CodeType::CodeType_t inType, IGC::CodeType::CodeType_t outType); protected: - MOCKABLE_VIRTUAL std::unique_ptr loadIgcLibrary() const; + MOCKABLE_VIRTUAL std::unique_ptr loadIgcLibrary(const char *libName) const; MOCKABLE_VIRTUAL CIF::CreateCIFMainFunc_t loadCreateIgcMainFunction() const; MOCKABLE_VIRTUAL CIF::RAII::UPtr_t createIgcMain(CIF::CreateCIFMainFunc_t createMainFunction) const; MOCKABLE_VIRTUAL bool isIgcInterfaceCompatible(const std::vector &interfacesToIgnore) const; diff --git a/shared/source/compiler_interface/compiler_interface.cpp b/shared/source/compiler_interface/compiler_interface.cpp index dcc64e530a..7bed73249d 100644 --- a/shared/source/compiler_interface/compiler_interface.cpp +++ b/shared/source/compiler_interface/compiler_interface.cpp @@ -52,6 +52,9 @@ void TranslationOutput::makeCopy(MemAndSize &dst, CIF::Builtins::BufferSimple *s CompilerInterface::CompilerInterface() : cache() { + if (debugManager.flags.FinalizerInputType.get() != 0) { + this->finalizerInputType = debugManager.flags.FinalizerInputType.get(); + } } CompilerInterface::~CompilerInterface() = default; @@ -59,7 +62,7 @@ TranslationOutput::ErrorCode CompilerInterface::build( const NEO::Device &device, const TranslationInput &input, TranslationOutput &output) { - if (false == isCompilerAvailable(input.srcType, input.outType)) { + if (false == isCompilerAvailable(&device, input.srcType, input.outType)) { return TranslationOutput::ErrorCode::compilerNotAvailable; } @@ -81,11 +84,12 @@ TranslationOutput::ErrorCode CompilerInterface::build( } std::string kernelFileHash; + const auto &igc = *getIgc(&device); if (cachingMode == CachingMode::Direct) { kernelFileHash = cache->getCachedFileName(device.getHardwareInfo(), input.src, input.apiOptions, - input.internalOptions, ArrayRef(), ArrayRef(), igcRevision, igcLibSize, igcLibMTime); + input.internalOptions, ArrayRef(), ArrayRef(), igc.revision, igc.libSize, igc.libMTime); bool success = CompilerCacheHelper::loadCacheAndSetOutput(*cache, kernelFileHash, output, device); if (success) { @@ -93,12 +97,13 @@ TranslationOutput::ErrorCode CompilerInterface::build( } } - auto inSrc = CIF::Builtins::CreateConstBuffer(igcMain.get(), input.src.begin(), input.src.size()); - auto fclOptions = CIF::Builtins::CreateConstBuffer(igcMain.get(), input.apiOptions.begin(), input.apiOptions.size()); - auto fclInternalOptions = CIF::Builtins::CreateConstBuffer(igcMain.get(), input.internalOptions.begin(), input.internalOptions.size()); + auto *igcMain = igc.entryPoint.get(); + auto inSrc = CIF::Builtins::CreateConstBuffer(igcMain, input.src.begin(), input.src.size()); + auto fclOptions = CIF::Builtins::CreateConstBuffer(igcMain, input.apiOptions.begin(), input.apiOptions.size()); + auto fclInternalOptions = CIF::Builtins::CreateConstBuffer(igcMain, input.internalOptions.begin(), input.internalOptions.size()); - auto idsBuffer = CIF::Builtins::CreateConstBuffer(igcMain.get(), nullptr, 0); - auto valuesBuffer = CIF::Builtins::CreateConstBuffer(igcMain.get(), nullptr, 0); + auto idsBuffer = CIF::Builtins::CreateConstBuffer(igcMain, nullptr, 0); + auto valuesBuffer = CIF::Builtins::CreateConstBuffer(igcMain, nullptr, 0); for (const auto &specConst : input.specializedValues) { idsBuffer->PushBackRawCopy(specConst.first); valuesBuffer->PushBackRawCopy(specConst.second); @@ -140,9 +145,10 @@ TranslationOutput::ErrorCode CompilerInterface::build( const ArrayRef irRef(intermediateRepresentation->GetMemory(), intermediateRepresentation->GetSize()); const ArrayRef specIdsRef(idsBuffer->GetMemory(), idsBuffer->GetSize()); const ArrayRef specValuesRef(valuesBuffer->GetMemory(), valuesBuffer->GetSize()); + const auto &igc = *getIgc(&device); kernelFileHash = cache->getCachedFileName(device.getHardwareInfo(), irRef, input.apiOptions, - input.internalOptions, specIdsRef, specValuesRef, igcRevision, igcLibSize, igcLibMTime); + input.internalOptions, specIdsRef, specValuesRef, igc.revision, igc.libSize, igc.libMTime); bool success = CompilerCacheHelper::loadCacheAndSetOutput(*cache, kernelFileHash, output, device); if (success) { @@ -150,23 +156,43 @@ TranslationOutput::ErrorCode CompilerInterface::build( } } - auto igcTranslationCtx = createIgcTranslationCtx(device, intermediateCodeType, IGC::CodeType::oclGenBin); + auto igcOutputType = IGC::CodeType::oclGenBin; + if (this->finalizerInputType != IGC::CodeType::undefined) { + igcOutputType = this->finalizerInputType; + } - auto igcOutput = translate(igcTranslationCtx.get(), intermediateRepresentation.get(), idsBuffer.get(), valuesBuffer.get(), - fclOptions.get(), fclInternalOptions.get(), input.gtPinInput); + auto igcTranslationCtx = createIgcTranslationCtx(device, intermediateCodeType, igcOutputType); - if (igcOutput == nullptr) { + auto buildOutput = translate(igcTranslationCtx.get(), intermediateRepresentation.get(), idsBuffer.get(), valuesBuffer.get(), + fclOptions.get(), fclInternalOptions.get(), input.gtPinInput); + + if (buildOutput == nullptr) { return TranslationOutput::ErrorCode::unknownError; } - TranslationOutput::makeCopy(output.backendCompilerLog, igcOutput->GetBuildLog()); + TranslationOutput::makeCopy(output.backendCompilerLog, buildOutput->GetBuildLog()); - if (igcOutput->Successful() == false) { + if (buildOutput->Successful() == false) { return TranslationOutput::ErrorCode::buildFailure; } - TranslationOutput::makeCopy(output.deviceBinary, igcOutput->GetOutput()); - TranslationOutput::makeCopy(output.debugData, igcOutput->GetDebugData()); + if (igcOutputType == this->finalizerInputType) { + TranslationOutput::makeCopy(output.finalizerInputRepresentation, buildOutput->GetOutput()); + + auto finalizerTranslationCtx = createFinalizerTranslationCtx(device, this->finalizerInputType, IGC::CodeType::oclGenBin); + + auto finalizerOutput = translate(finalizerTranslationCtx.get(), buildOutput->GetOutput(), + fclOptions.get(), fclInternalOptions.get(), nullptr); + buildOutput = std::move(finalizerOutput); + + TranslationOutput::append(output.backendCompilerLog, buildOutput->GetBuildLog(), "\n", 0); + if (buildOutput->Successful() == false) { + return TranslationOutput::ErrorCode::buildFailure; + } + } + + TranslationOutput::makeCopy(output.deviceBinary, buildOutput->GetOutput()); + TranslationOutput::makeCopy(output.debugData, buildOutput->GetDebugData()); if (cache != nullptr && cache->getConfig().enabled) { CompilerCacheHelper::packAndCacheBinary(*cache, kernelFileHash, NEO::getTargetDevice(device.getRootDeviceEnvironment()), output); @@ -184,7 +210,7 @@ TranslationOutput::ErrorCode CompilerInterface::compile( return TranslationOutput::ErrorCode::alreadyCompiled; } - if (false == isCompilerAvailable(input.srcType, input.outType)) { + if (false == isCompilerAvailable(&device, input.srcType, input.outType)) { return TranslationOutput::ErrorCode::compilerNotAvailable; } @@ -194,9 +220,10 @@ TranslationOutput::ErrorCode CompilerInterface::compile( outType = getPreferredIntermediateRepresentation(device); } - auto fclSrc = CIF::Builtins::CreateConstBuffer(fclMain.get(), input.src.begin(), input.src.size()); - auto fclOptions = CIF::Builtins::CreateConstBuffer(fclMain.get(), input.apiOptions.begin(), input.apiOptions.size()); - auto fclInternalOptions = CIF::Builtins::CreateConstBuffer(fclMain.get(), input.internalOptions.begin(), input.internalOptions.size()); + auto *fclMain = fcl.entryPoint.get(); + auto fclSrc = CIF::Builtins::CreateConstBuffer(fclMain, input.src.begin(), input.src.size()); + auto fclOptions = CIF::Builtins::CreateConstBuffer(fclMain, input.apiOptions.begin(), input.apiOptions.size()); + auto fclInternalOptions = CIF::Builtins::CreateConstBuffer(fclMain, input.internalOptions.begin(), input.internalOptions.size()); auto fclTranslationCtx = createFclTranslationCtx(device, input.srcType, outType); @@ -223,13 +250,14 @@ TranslationOutput::ErrorCode CompilerInterface::link( const NEO::Device &device, const TranslationInput &input, TranslationOutput &output) { - if (false == isCompilerAvailable(input.srcType, input.outType)) { + if (false == isCompilerAvailable(&device, input.srcType, input.outType)) { return TranslationOutput::ErrorCode::compilerNotAvailable; } - auto inSrc = CIF::Builtins::CreateConstBuffer(igcMain.get(), input.src.begin(), input.src.size()); - auto igcOptions = CIF::Builtins::CreateConstBuffer(igcMain.get(), input.apiOptions.begin(), input.apiOptions.size()); - auto igcInternalOptions = CIF::Builtins::CreateConstBuffer(igcMain.get(), input.internalOptions.begin(), input.internalOptions.size()); + auto *igcMain = getIgc(&device)->entryPoint.get(); + auto inSrc = CIF::Builtins::CreateConstBuffer(igcMain, input.src.begin(), input.src.size()); + auto igcOptions = CIF::Builtins::CreateConstBuffer(igcMain, input.apiOptions.begin(), input.apiOptions.size()); + auto igcInternalOptions = CIF::Builtins::CreateConstBuffer(igcMain, input.internalOptions.begin(), input.internalOptions.size()); if (inSrc == nullptr) { return TranslationOutput::ErrorCode::unknownError; @@ -269,15 +297,16 @@ TranslationOutput::ErrorCode CompilerInterface::link( } TranslationOutput::ErrorCode CompilerInterface::getSpecConstantsInfo(const NEO::Device &device, ArrayRef srcSpirV, SpecConstantInfo &output) { - if (false == isIgcAvailable()) { + if (false == isIgcAvailable(&device)) { return TranslationOutput::ErrorCode::compilerNotAvailable; } auto igcTranslationCtx = createIgcTranslationCtx(device, IGC::CodeType::spirV, IGC::CodeType::oclGenBin); - auto inSrc = CIF::Builtins::CreateConstBuffer(igcMain.get(), srcSpirV.begin(), srcSpirV.size()); - output.idsBuffer = CIF::Builtins::CreateConstBuffer(igcMain.get(), nullptr, 0); - output.sizesBuffer = CIF::Builtins::CreateConstBuffer(igcMain.get(), nullptr, 0); + auto *igcMain = getIgc(&device)->entryPoint.get(); + auto inSrc = CIF::Builtins::CreateConstBuffer(igcMain, srcSpirV.begin(), srcSpirV.size()); + output.idsBuffer = CIF::Builtins::CreateConstBuffer(igcMain, nullptr, 0); + output.sizesBuffer = CIF::Builtins::CreateConstBuffer(igcMain, nullptr, 0); auto retVal = getSpecConstantsInfoImpl(igcTranslationCtx.get(), inSrc.get(), output.idsBuffer.get(), output.sizesBuffer.get()); @@ -292,13 +321,14 @@ TranslationOutput::ErrorCode CompilerInterface::createLibrary( NEO::Device &device, const TranslationInput &input, TranslationOutput &output) { - if (false == isIgcAvailable()) { + if (false == isIgcAvailable(&device)) { return TranslationOutput::ErrorCode::compilerNotAvailable; } - auto igcSrc = CIF::Builtins::CreateConstBuffer(igcMain.get(), input.src.begin(), input.src.size()); - auto igcOptions = CIF::Builtins::CreateConstBuffer(igcMain.get(), input.apiOptions.begin(), input.apiOptions.size()); - auto igcInternalOptions = CIF::Builtins::CreateConstBuffer(igcMain.get(), input.internalOptions.begin(), input.internalOptions.size()); + auto *igcMain = getIgc(&device)->entryPoint.get(); + auto igcSrc = CIF::Builtins::CreateConstBuffer(igcMain, input.src.begin(), input.src.size()); + auto igcOptions = CIF::Builtins::CreateConstBuffer(igcMain, input.apiOptions.begin(), input.apiOptions.size()); + auto igcInternalOptions = CIF::Builtins::CreateConstBuffer(igcMain, input.internalOptions.begin(), input.internalOptions.size()); auto intermediateRepresentation = IGC::CodeType::llvmBc; auto igcTranslationCtx = createIgcTranslationCtx(device, IGC::CodeType::elf, intermediateRepresentation); @@ -324,7 +354,7 @@ TranslationOutput::ErrorCode CompilerInterface::createLibrary( TranslationOutput::ErrorCode CompilerInterface::getSipKernelBinary(NEO::Device &device, SipKernelType type, std::vector &retBinary, std::vector &stateSaveAreaHeader) { - if (false == isIgcAvailable()) { + if (false == isIgcAvailable(&device)) { return TranslationOutput::ErrorCode::compilerNotAvailable; } @@ -358,6 +388,7 @@ TranslationOutput::ErrorCode CompilerInterface::getSipKernelBinary(NEO::Device & return TranslationOutput::ErrorCode::unknownError; } + auto *igcMain = getIgc(&device)->entryPoint.get(); auto systemRoutineBuffer = igcMain->CreateBuiltin(); auto stateSaveAreaBuffer = igcMain->CreateBuiltin(); @@ -381,20 +412,20 @@ CIF::RAII::UPtr_t CompilerInterface::getIg } bool CompilerInterface::loadFcl() { - return NEO::loadCompiler(Os::frontEndDllName, fclLib, fclMain); + return NEO::loadCompiler(Os::frontEndDllName, fcl.library, fcl.entryPoint); } -bool CompilerInterface::loadIgc() { - bool result = NEO::loadCompiler(Os::igcDllName, igcLib, igcMain); +bool CompilerInterface::loadIgcBasedCompiler(CompilerLibraryEntry &entry, const char *libName) { + bool result = NEO::loadCompiler(libName, entry.library, entry.entryPoint); if (result) { - std::string igcPath = igcLib->getFullPath(); - igcLibSize = NEO::getFileSize(igcPath); - igcLibMTime = NEO::getFileModificationTime(igcPath); + std::string libPath = entry.library->getFullPath(); + entry.libSize = NEO::getFileSize(libPath); + entry.libMTime = NEO::getFileModificationTime(libPath); - auto igcDeviceCtx3 = igcMain->CreateInterface>(); + auto igcDeviceCtx3 = entry.entryPoint->CreateInterface>(); if (igcDeviceCtx3) { - igcRevision = igcDeviceCtx3->GetIGCRevision(); + entry.revision = igcDeviceCtx3->GetIGCRevision(); } } return result; @@ -402,16 +433,11 @@ bool CompilerInterface::loadIgc() { bool CompilerInterface::initialize(std::unique_ptr &&cache, bool requireFcl) { bool fclAvailable = requireFcl ? this->loadFcl() : false; - bool igcAvailable = this->loadIgc(); - bool compilerVersionCorrect = true; - - if (!debugManager.flags.ZebinIgnoreIcbeVersion.get()) { - compilerVersionCorrect = verifyIcbeVersion(); - } + bool igcAvailable = this->loadIgcBasedCompiler(defaultIgc, Os::igcDllName); this->cache.swap(cache); - return this->cache && igcAvailable && (fclAvailable || (false == requireFcl)) && compilerVersionCorrect; + return this->cache && igcAvailable && (fclAvailable || (false == requireFcl)); } IGC::FclOclDeviceCtxTagOCL *CompilerInterface::getFclDeviceCtx(const Device &device) { @@ -421,12 +447,12 @@ IGC::FclOclDeviceCtxTagOCL *CompilerInterface::getFclDeviceCtx(const Device &dev return it->second.get(); } - if (fclMain == nullptr) { + if (fcl.entryPoint == nullptr) { DEBUG_BREAK_IF(true); // compiler not available return nullptr; } - auto newDeviceCtx = fclMain->CreateInterface(); + auto newDeviceCtx = fcl.entryPoint->CreateInterface(); if (newDeviceCtx == nullptr) { DEBUG_BREAK_IF(true); // could not create device context return nullptr; @@ -453,10 +479,12 @@ IGC::IgcOclDeviceCtxTagOCL *CompilerInterface::getIgcDeviceCtx(const Device &dev return it->second.get(); } - if (igcMain == nullptr) { + auto *igc = getIgc(&device); + if (igc == nullptr) { DEBUG_BREAK_IF(true); // compiler not available return nullptr; } + auto *igcMain = igc->entryPoint.get(); auto newDeviceCtx = igcMain->CreateInterface(); if (newDeviceCtx == nullptr) { @@ -490,6 +518,51 @@ IGC::IgcOclDeviceCtxTagOCL *CompilerInterface::getIgcDeviceCtx(const Device &dev return igcDeviceContexts[&device].get(); } +IGC::IgcOclDeviceCtxTagOCL *CompilerInterface::getFinalizerDeviceCtx(const Device &device) { + auto ulock = this->lock(); + auto it = finalizerDeviceContexts.find(&device); + if (it != finalizerDeviceContexts.end()) { + return it->second.get(); + } + + auto finalizer = this->getFinalizer(&device); + if (finalizer == nullptr) { + DEBUG_BREAK_IF(true); // compiler not available + return nullptr; + } + + auto newDeviceCtx = finalizer->entryPoint->CreateInterface(); + if (newDeviceCtx == nullptr) { + DEBUG_BREAK_IF(true); // could not create device context + return nullptr; + } + + newDeviceCtx->SetProfilingTimerResolution(static_cast(device.getDeviceInfo().outProfilingTimerResolution)); + auto igcPlatform = newDeviceCtx->GetPlatformHandle(); + auto igcGtSystemInfo = newDeviceCtx->GetGTSystemInfoHandle(); + auto igcFtrWa = newDeviceCtx->GetIgcFeaturesAndWorkaroundsHandle(); + if (false == NEO::areNotNullptr(igcPlatform.get(), igcGtSystemInfo.get(), igcFtrWa.get())) { + DEBUG_BREAK_IF(true); // could not acquire handles to device descriptors + return nullptr; + } + const HardwareInfo *hwInfo = &device.getHardwareInfo(); + auto productFamily = debugManager.flags.ForceCompilerUsePlatform.get(); + if (productFamily != "unk") { + getHwInfoForPlatformString(productFamily, hwInfo); + } + + populateIgcPlatform(*igcPlatform, *hwInfo); + IGC::GtSysInfoHelper::PopulateInterfaceWith(*igcGtSystemInfo, hwInfo->gtSystemInfo); + + auto &compilerProductHelper = device.getCompilerProductHelper(); + igcFtrWa->SetFtrGpGpuMidThreadLevelPreempt(compilerProductHelper.isMidThreadPreemptionSupported(*hwInfo)); + igcFtrWa->SetFtrWddm2Svm(device.getHardwareInfo().featureTable.flags.ftrWddm2Svm); + igcFtrWa->SetFtrPooledEuEnabled(device.getHardwareInfo().featureTable.flags.ftrPooledEuEnabled); + + finalizerDeviceContexts[&device] = std::move(newDeviceCtx); + return finalizerDeviceContexts[&device].get(); +} + IGC::CodeType::CodeType_t CompilerInterface::getPreferredIntermediateRepresentation(const Device &device) { return getFclDeviceCtx(device)->GetPreferredIntermediateRepresentation(); } @@ -521,50 +594,18 @@ CIF::RAII::UPtr_t CompilerInterface::createIgcT return deviceCtx->CreateTranslationCtx(inType, outType); } -template