24.08
|
Go to the documentation of this file.
13 #include <fmt/format.h>
17 #if defined(__unix__) || defined(__APPLE__)
21 #if !defined(DYNAMIC_BACKEND_PATHS)
22 #define DYNAMIC_BACKEND_PATHS ""
31 static void*
OpenHandle(
const std::string& sharedObjectPath);
32 static void CloseHandle(
const void* sharedObjectHandle);
34 template<
typename EntryPo
intType>
35 static EntryPointType
GetEntryPoint(
const void* sharedObjectHandle,
const char* symbolName);
39 static std::vector<std::string>
GetBackendPaths(
const std::string& overrideBackendPath =
"");
41 static std::vector<std::string>
GetSharedObjects(
const std::vector<std::string>& backendPaths);
43 static std::vector<DynamicBackendPtr>
CreateDynamicBackends(
const std::vector<std::string>& sharedObjects);
52 const std::vector<DynamicBackendPtr>& dynamicBackends);
55 static std::string GetDlError();
61 template<
typename EntryPo
intType>
64 #if defined(__unix__) || defined(__APPLE__)
65 if (sharedObjectHandle ==
nullptr)
70 if (symbolName ==
nullptr)
75 auto entryPoint =
reinterpret_cast<EntryPointType
>(dlsym(
const_cast<void*
>(sharedObjectHandle), symbolName));
78 throw RuntimeException(fmt::format(
"GetEntryPoint error: {}", GetDlError()));
static std::vector< DynamicBackendPtr > CreateDynamicBackends(const std::vector< std::string > &sharedObjects)
std::unordered_set< BackendId > BackendIdSet
static bool IsBackendCompatibleImpl(const BackendVersion &backendApiVersion, const BackendVersion &backendVersion)
Protected methods for testing purposes.
static void * OpenHandle(const std::string &sharedObjectPath)
static BackendIdSet RegisterDynamicBackendsImpl(BackendRegistry &backendRegistry, const std::vector< DynamicBackendPtr > &dynamicBackends)
static std::vector< std::string > GetSharedObjects(const std::vector< std::string > &backendPaths)
static bool IsPathValid(const std::string &path)
static void CloseHandle(const void *sharedObjectHandle)
static BackendIdSet RegisterDynamicBackends(const std::vector< DynamicBackendPtr > &dynamicBackends)
static void DeregisterDynamicBackends(const BackendIdSet &dynamicBackends)
void IgnoreUnused(Ts &&...)
static std::vector< std::string > GetBackendPaths(const std::string &overrideBackendPath="")
Copyright (c) 2021 ARM Limited and Contributors.
static EntryPointType GetEntryPoint(const void *sharedObjectHandle, const char *symbolName)
static std::vector< std::string > GetBackendPathsImpl(const std::string &backendPaths)
static bool IsBackendCompatible(const BackendVersion &backendVersion)