Commit dbad9da4 authored by Pruthvi's avatar Pruthvi Committed by Scott Cyphers

private function to static initialize all the backend for static library builds (#3379)

* - private function to static initlize all the backend for static library builds

* - export backend function on windows

* -fix_typo
parent 3f4055c1
......@@ -53,6 +53,7 @@ void runtime::BackendManager::register_backend(const string& name, BackendConstr
vector<string> runtime::BackendManager::get_registered_backends()
{
initialize_backends();
vector<string> rc;
for (const auto& p : get_registry())
{
......@@ -67,8 +68,7 @@ vector<string> runtime::BackendManager::get_registered_backends()
}
return rc;
}
shared_ptr<runtime::Backend> runtime::BackendManager::create_backend(const std::string& config)
void runtime::BackendManager::initialize_backends()
{
#ifdef NGRAPH_INTERPRETER_STATIC_LIB_ENABLE
runtime::interpreter::static_initialize();
......@@ -77,7 +77,11 @@ shared_ptr<runtime::Backend> runtime::BackendManager::create_backend(const std::
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
runtime::cpu::static_initialize();
#endif
}
shared_ptr<runtime::Backend> runtime::BackendManager::create_backend(const std::string& config)
{
initialize_backends();
shared_ptr<runtime::Backend> backend;
string type = config;
......
......@@ -64,6 +64,7 @@ public:
static std::vector<std::string> get_registered_backends();
private:
static void initialize_backends();
static std::shared_ptr<runtime::Backend> create_backend(const std::string& type);
static std::unordered_map<std::string, BackendConstructor*>& get_registry();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment