mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-19 06:24:51 +08:00
refactor: don't call OsLibrary::load directly, use function pointer
this allows mocking this call in ULT Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
006285105d
commit
579af57161
@@ -75,6 +75,7 @@ set(CLOC_LIB_SRCS_LIB
|
||||
${NEO_SHARED_DIRECTORY}/helpers/hw_info_helper.h
|
||||
${NEO_SHARED_DIRECTORY}/helpers/product_config_helper.cpp
|
||||
${NEO_SHARED_DIRECTORY}/helpers/product_config_helper.h
|
||||
${NEO_SHARED_DIRECTORY}/os_interface/os_library.cpp
|
||||
${NEO_SHARED_DIRECTORY}/os_interface/os_library.h
|
||||
${NEO_SHARED_DIRECTORY}/sku_info/definitions${BRANCH_DIR_SUFFIX}sku_info.cpp
|
||||
${NEO_SHARED_DIRECTORY}/utilities/directory.h
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2023 Intel Corporation
|
||||
* Copyright (C) 2019-2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -42,7 +42,7 @@ struct IgaWrapper::Impl {
|
||||
iga.optsContext.cb = sizeof(igaLib.optsContext);
|
||||
iga.optsContext.gen = igaGen;
|
||||
|
||||
iga.library.reset(NEO::OsLibrary::load(Os::igaDllName));
|
||||
iga.library.reset(NEO::OsLibrary::loadFunc(Os::igaDllName));
|
||||
if (iga.library == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022-2023 Intel Corporation
|
||||
* Copyright (C) 2022-2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -81,7 +81,7 @@ int OclocFclFacade::initialize(const HardwareInfo &hwInfo) {
|
||||
}
|
||||
|
||||
std::unique_ptr<OsLibrary> OclocFclFacade::loadFclLibrary() const {
|
||||
return std::unique_ptr<OsLibrary>{OsLibrary::load(Os::frontEndDllName)};
|
||||
return std::unique_ptr<OsLibrary>{OsLibrary::loadFunc(Os::frontEndDllName)};
|
||||
}
|
||||
|
||||
CIF::CreateCIFMainFunc_t OclocFclFacade::loadCreateFclMainFunction() const {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022-2023 Intel Corporation
|
||||
* Copyright (C) 2022-2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -112,7 +112,7 @@ int OclocIgcFacade::initialize(const HardwareInfo &hwInfo) {
|
||||
}
|
||||
|
||||
std::unique_ptr<OsLibrary> OclocIgcFacade::loadIgcLibrary() const {
|
||||
return std::unique_ptr<OsLibrary>{OsLibrary::load(Os::igcDllName)};
|
||||
return std::unique_ptr<OsLibrary>{OsLibrary::loadFunc(Os::igcDllName)};
|
||||
}
|
||||
|
||||
CIF::CreateCIFMainFunc_t OclocIgcFacade::loadCreateIgcMainFunction() const {
|
||||
|
||||
@@ -272,7 +272,7 @@ std::optional<int> invokeFormerOcloc(const std::string &formerOclocName, unsigne
|
||||
return {};
|
||||
}
|
||||
|
||||
std::unique_ptr<OsLibrary> oclocLib(OsLibrary::load(formerOclocName));
|
||||
std::unique_ptr<OsLibrary> oclocLib(OsLibrary::loadFunc(formerOclocName));
|
||||
|
||||
if (!oclocLib ||
|
||||
!oclocLib->isLoaded()) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2023 Intel Corporation
|
||||
* Copyright (C) 2018-2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -88,7 +88,7 @@ void SehException::getCallStack(unsigned int code, struct _EXCEPTION_POINTERS *e
|
||||
DWORD displacement = 0;
|
||||
DWORD64 displacement64 = 0;
|
||||
|
||||
std::unique_ptr<NEO::OsLibrary> psApiLib(NEO::OsLibrary::load("psapi.dll"));
|
||||
std::unique_ptr<NEO::OsLibrary> psApiLib(NEO::OsLibrary::loadFunc("psapi.dll"));
|
||||
auto getMappedFileName = reinterpret_cast<getMappedFileNameFunction>(psApiLib->getProcAddress("GetMappedFileNameA"));
|
||||
|
||||
size_t callstackCounter = 0;
|
||||
|
||||
Reference in New Issue
Block a user