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 <jaroslaw.chodor@intel.com>
This commit is contained in:
Chodor, Jaroslaw
2024-10-14 18:23:13 +00:00
committed by Compute-Runtime-Automation
parent 69046526bd
commit 5f908ce092
13 changed files with 479 additions and 460 deletions

View File

@@ -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<OsLibrary> OclocIgcFacade::loadIgcLibrary() const {
return std::unique_ptr<OsLibrary>{OsLibrary::loadFunc({Os::igcDllName})};
std::unique_ptr<OsLibrary> OclocIgcFacade::loadIgcLibrary(const char *libName) const {
auto effectiveLibName = libName ? libName : Os::igcDllName;
return std::unique_ptr<OsLibrary>{OsLibrary::loadFunc({effectiveLibName})};
}
CIF::CreateCIFMainFunc_t OclocIgcFacade::loadCreateIgcMainFunction() const {

View File

@@ -43,7 +43,7 @@ class OclocIgcFacade {
CIF::RAII::UPtr_t<IGC::IgcOclTranslationCtxTagOCL> createTranslationContext(IGC::CodeType::CodeType_t inType, IGC::CodeType::CodeType_t outType);
protected:
MOCKABLE_VIRTUAL std::unique_ptr<OsLibrary> loadIgcLibrary() const;
MOCKABLE_VIRTUAL std::unique_ptr<OsLibrary> loadIgcLibrary(const char *libName) const;
MOCKABLE_VIRTUAL CIF::CreateCIFMainFunc_t loadCreateIgcMainFunction() const;
MOCKABLE_VIRTUAL CIF::RAII::UPtr_t<CIF::CIFMain> createIgcMain(CIF::CreateCIFMainFunc_t createMainFunction) const;
MOCKABLE_VIRTUAL bool isIgcInterfaceCompatible(const std::vector<CIF::InterfaceId_t> &interfacesToIgnore) const;