#include <RuntimeLibManager.h>
Definition at line 4 of file RuntimeLibManager.h.
bool RuntimeLibManager::is_libtorch_loaded |
( |
| ) |
|
|
static |
void RuntimeLibManager::loadRuntimeLibs |
( |
const std::string & |
torch_lib_path = std::string() | ) |
|
|
static |
Definition at line 52 of file RuntimeLibManager.cpp.
References logger::FATAL, get_torch_table_functions_path(), is_libtorch_loaded_, libtorch, libTorchTFs, LOG, and logger::WARNING.
Referenced by DBHandler::initialize(), and QueryRunner::QueryRunner::QueryRunner().
62 if (!torch_lib_path.empty()) {
63 boost::dll::fs::path lib_path(torch_lib_path);
64 libtorch = boost::dll::shared_library(
66 boost::dll::load_mode::rtld_global | boost::dll::load_mode::rtld_deepbind);
68 libtorch = boost::dll::shared_library(
"libtorch",
69 boost::dll::load_mode::search_system_folders |
70 boost::dll::load_mode::append_decorations |
71 boost::dll::load_mode::rtld_global |
72 boost::dll::load_mode::rtld_deepbind);
76 throw(std::runtime_error(
77 "Failed to load runtime library LibTorch. Support for library is disabled!"));
80 LOG(
WARNING) <<
"This HeavyDB was built against LibTorch version " << TORCH_VERSION
81 <<
". Using a different version of LibTorch may cause breaking behavior!";
94 boost::dll::load_mode::rtld_lazy | boost::dll::load_mode::search_system_folders |
95 boost::dll::load_mode::rtld_global | boost::dll::load_mode::append_decorations |
96 boost::dll::load_mode::rtld_deepbind);
99 std::runtime_error(
"Failed to load LibTorch table function module. LibTorch "
100 "table function support is disabled!"));
104 LOG(
FATAL) <<
"Load-time table function module does not contain "
105 "'init_table_functions' symbol!";
109 auto initFunction =
libTorchTFs.get<void(
void)>(
"init_table_functions");
boost::dll::shared_library libtorch
static bool is_libtorch_loaded_
boost::filesystem::path get_torch_table_functions_path()
boost::dll::shared_library libTorchTFs
void RuntimeLibManager::loadTestRuntimeLibs |
( |
| ) |
|
|
static |
Definition at line 118 of file RuntimeLibManager.cpp.
References logger::FATAL, get_runtime_test_lib_path(), get_runtime_test_lib_tfs_path(), LOG, testLib, and testLibTFs.
Referenced by QueryRunner::QueryRunner::QueryRunner().
120 boost::dll::load_mode::append_decorations |
121 boost::dll::load_mode::rtld_global |
122 boost::dll::load_mode::search_system_folders |
123 boost::dll::load_mode::rtld_deepbind);
126 throw(std::runtime_error(
"Failed to load test runtime library!"));
131 boost::dll::load_mode::rtld_lazy | boost::dll::load_mode::search_system_folders |
132 boost::dll::load_mode::rtld_global | boost::dll::load_mode::append_decorations |
133 boost::dll::load_mode::rtld_deepbind);
135 throw(std::runtime_error(
"Failed to load test runtime library table functions!!"));
138 if (!
testLibTFs.has(
"init_table_functions")) {
140 <<
"Test runtime table function library has no init_table_functions symbol!";
142 auto initFunction =
testLibTFs.get<void(
void)>(
"init_table_functions");
boost::filesystem::path get_runtime_test_lib_path()
boost::dll::shared_library testLib
boost::dll::shared_library testLibTFs
boost::filesystem::path get_runtime_test_lib_tfs_path()
bool RuntimeLibManager::is_libtorch_loaded_ |
|
staticprivate |
The documentation for this class was generated from the following files: