mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-24 12:23:05 +08:00
refactor: Add OV detection mechanism for ULLS light
Related-To: NEO-13922 Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
b60c02d597
commit
b0e3d8656e
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2024 Intel Corporation
|
||||
* Copyright (C) 2019-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "shared/source/helpers/debug_helpers.h"
|
||||
#include "shared/source/os_interface/linux/sys_calls.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <dlfcn.h>
|
||||
#include <link.h>
|
||||
|
||||
@@ -81,5 +82,22 @@ std::string OsLibrary::getFullPath() {
|
||||
}
|
||||
return std::string();
|
||||
}
|
||||
|
||||
bool isLibraryLoaded(const std::string &libraryName) {
|
||||
auto handle = SysCalls::dlopen(0, RTLD_LAZY);
|
||||
struct link_map *map = nullptr;
|
||||
int retVal = NEO::SysCalls::dlinfo(handle, RTLD_DI_LINKMAP, &map);
|
||||
if (retVal == 0 && map != nullptr) {
|
||||
while (map) {
|
||||
if (strstr(map->l_name, libraryName.c_str())) {
|
||||
dlclose(handle);
|
||||
return true;
|
||||
}
|
||||
map = map->l_next;
|
||||
}
|
||||
}
|
||||
dlclose(handle);
|
||||
return false;
|
||||
}
|
||||
} // namespace Linux
|
||||
} // namespace NEO
|
||||
|
||||
Reference in New Issue
Block a user