/* * Copyright (C) 2022-2025 Intel Corporation * * SPDX-License-Identifier: MIT * */ #pragma once #include "shared/source/helpers/non_copyable_or_moveable.h" #include "cif/common/cif_main.h" #include "cif/import/library_api.h" #include "ocl_igc_interface/code_type.h" #include "ocl_igc_interface/igc_ocl_device_ctx.h" #include #include class OclocArgHelper; namespace NEO { class CompilerProductHelper; class OsLibrary; struct HardwareInfo; class OclocIgcFacade : NEO::NonCopyableAndNonMovableClass { public: OclocIgcFacade(OclocArgHelper *argHelper); MOCKABLE_VIRTUAL ~OclocIgcFacade(); int initialize(const HardwareInfo &hwInfo); bool isInitialized() const; const char *getIgcRevision(); size_t getIgcLibSize(); time_t getIgcLibMTime(); CIF::RAII::UPtr_t createConstBuffer(const void *data, size_t size); CIF::RAII::UPtr_t createTranslationContext(IGC::CodeType::CodeType_t inType, IGC::CodeType::CodeType_t outType); protected: 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; MOCKABLE_VIRTUAL std::string getIncompatibleInterface(const std::vector &interfacesToIgnore) const; MOCKABLE_VIRTUAL bool isPatchtokenInterfaceSupported() const; MOCKABLE_VIRTUAL CIF::RAII::UPtr_t> createIgcDeviceContext3() const; MOCKABLE_VIRTUAL CIF::RAII::UPtr_t createIgcDeviceContext() const; MOCKABLE_VIRTUAL CIF::RAII::UPtr_t getIgcPlatformHandle() const; MOCKABLE_VIRTUAL CIF::RAII::UPtr_t getGTSystemInfoHandle() const; MOCKABLE_VIRTUAL CIF::RAII::UPtr_t getIgcFeaturesAndWorkaroundsHandle() const; void populateWithFeatures(IGC::IgcFeaturesAndWorkaroundsTagOCL *handle, const HardwareInfo &hwInfo, const CompilerProductHelper *compilerProductHelper) const; OclocArgHelper *argHelper{}; std::unique_ptr igcLib; std::vector igcRevision; size_t igcLibSize{0}; time_t igcLibMTime{0}; CIF::RAII::UPtr_t igcMain; CIF::RAII::UPtr_t igcDeviceCtx; bool initialized{false}; }; static_assert(NEO::NonCopyableAndNonMovable); } // namespace NEO