Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
ngraph
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ngraph
Commits
5e637637
Commit
5e637637
authored
Jul 17, 2019
by
pruthvi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- call static_initlize from the backend_manager
- use gaurds to coditionally compile the code
parent
f95d7167
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
3 deletions
+16
-3
CMakeLists.txt
CMakeLists.txt
+2
-0
backend_manager.cpp
src/ngraph/runtime/backend_manager.cpp
+9
-0
cpu_backend.cpp
src/ngraph/runtime/cpu/cpu_backend.cpp
+3
-1
cpu_backend.hpp
src/ngraph/runtime/cpu/cpu_backend.hpp
+1
-1
int_backend.cpp
src/ngraph/runtime/interpreter/int_backend.cpp
+1
-1
No files found.
CMakeLists.txt
View file @
5e637637
...
...
@@ -261,6 +261,7 @@ NORMALIZE_BOOL(NGRAPH_PLAIDML_ENABLE)
NORMALIZE_BOOL
(
NGRAPH_JSON_ENABLE
)
NORMALIZE_BOOL
(
NGRAPH_STATIC_LIB_ENABLE
)
NORMALIZE_BOOL
(
NGRAPH_INTERPRETER_STATIC_LIB_ENABLE
)
NORMALIZE_BOOL
(
NGRAPH_CPU_STATIC_LIB_ENABLE
)
message
(
STATUS
"NGRAPH_UNIT_TEST_ENABLE:
${
NGRAPH_UNIT_TEST_ENABLE
}
"
)
message
(
STATUS
"NGRAPH_TOOLS_ENABLE:
${
NGRAPH_TOOLS_ENABLE
}
"
)
...
...
@@ -286,6 +287,7 @@ message(STATUS "NGRAPH_DISTRIBUTED_ENABLE: ${NGRAPH_DISTRIBUTED_ENABL
message
(
STATUS
"NGRAPH_JSON_ENABLE:
${
NGRAPH_JSON_ENABLE
}
"
)
message
(
STATUS
"NGRAPH_STATIC_LIB_ENABLE:
${
NGRAPH_STATIC_LIB_ENABLE
}
"
)
message
(
STATUS
"NGRAPH_INTERPRETER_STATIC_LIB_ENABLE:
${
NGRAPH_INTERPRETER_STATIC_LIB_ENABLE
}
"
)
message
(
STATUS
"NGRAPH_CPU_STATIC_LIB_ENABLE:
${
NGRAPH_CPU_STATIC_LIB_ENABLE
}
"
)
#-----------------------------------------------------------------------------------------------
# Installation logic...
...
...
src/ngraph/runtime/backend_manager.cpp
View file @
5e637637
...
...
@@ -25,6 +25,7 @@
#include "ngraph/file_util.hpp"
#include "ngraph/runtime/backend.hpp"
#include "ngraph/runtime/backend_manager.hpp"
#include "ngraph/runtime/cpu/static_initialize.hpp"
#include "ngraph/runtime/interpreter/static_initialize.hpp"
#include "ngraph/util.hpp"
...
...
@@ -69,6 +70,14 @@ vector<string> runtime::BackendManager::get_registered_backends()
shared_ptr
<
runtime
::
Backend
>
runtime
::
BackendManager
::
create_backend
(
const
std
::
string
&
config
)
{
#ifdef NGRAPH_INTERPRETER_STATIC_LIB_ENABLE
runtime
::
interpreter
::
static_initialize
();
#endif
#ifdef NGRAPH_CPU_STATIC_LIB_ENABLE
runtime
::
cpu
::
static_initialize
();
#endif
shared_ptr
<
runtime
::
Backend
>
backend
;
string
type
=
config
;
...
...
src/ngraph/runtime/cpu/cpu_backend.cpp
View file @
5e637637
...
...
@@ -51,7 +51,7 @@ runtime::BackendConstructor* runtime::cpu::get_backend_constructor_pointer()
return
s_backend_constructor
.
get
();
}
#ifndef
CPU_BACKEND_STATIC
#ifndef
NGRAPH_CPU_STATIC_LIB_ENABLE
extern
"C"
runtime
::
BackendConstructor
*
get_backend_constructor_pointer
()
{
return
runtime
::
cpu
::
get_backend_constructor_pointer
();
...
...
@@ -70,6 +70,7 @@ void runtime::cpu::static_initialize()
namespace
{
#ifndef NGRAPH_CPU_STATIC_LIB_ENABLE
static
class
CPUStaticInit
{
public
:
...
...
@@ -79,6 +80,7 @@ namespace
}
~
CPUStaticInit
()
{}
}
s_cpu_static_init
;
#endif
}
runtime
::
cpu
::
CPU_Backend
::~
CPU_Backend
()
...
...
src/ngraph/runtime/cpu/cpu_backend.hpp
View file @
5e637637
...
...
@@ -34,7 +34,7 @@ namespace ngraph
{
class
CPU_ExternalFunction
;
class
CPU_CallFrame
;
ngraph
::
runtime
::
BackendConstructor
*
get_backend_constructor_pointer
();
BackendConstructor
*
get_backend_constructor_pointer
();
class
CPU_BACKEND_API
CPU_Backend
:
public
runtime
::
Backend
{
public
:
...
...
src/ngraph/runtime/interpreter/int_backend.cpp
View file @
5e637637
...
...
@@ -43,7 +43,7 @@ runtime::BackendConstructor* runtime::interpreter::get_backend_constructor_point
return
s_backend_constructor
.
get
();
}
#ifndef
INTERPRETER_BACKEND_STATIC
#ifndef
NGRAPH_INTERPRETER_STATIC_LIB_ENABLE
extern
"C"
runtime
::
BackendConstructor
*
get_backend_constructor_pointer
()
{
return
runtime
::
interpreter
::
get_backend_constructor_pointer
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment