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
19b2e90a
Commit
19b2e90a
authored
Sep 22, 2018
by
Jaikrishnan Menon
Committed by
Robert Kimball
Sep 22, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Force correct initialization order for ctors (#1666)
parent
c671a2b7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
9 deletions
+14
-9
cpu_builder.cpp
src/ngraph/runtime/cpu/cpu_builder.cpp
+9
-4
cpu_builder.hpp
src/ngraph/runtime/cpu/cpu_builder.hpp
+3
-3
cpu_external_function.cpp
src/ngraph/runtime/cpu/cpu_external_function.cpp
+2
-2
No files found.
src/ngraph/runtime/cpu/cpu_builder.cpp
View file @
19b2e90a
...
...
@@ -362,10 +362,15 @@ namespace ngraph
#define TI(x) type_index(typeid(x))
BuildOpMap
build_dispatcher
{
{
TI
(
ngraph
::
op
::
Parameter
),
&
runtime
::
cpu
::
Builder
::
nop
},
{
TI
(
ngraph
::
runtime
::
cpu
::
op
::
ConvertLayout
),
&
runtime
::
cpu
::
Builder
::
build
<
ngraph
::
runtime
::
cpu
::
op
::
ConvertLayout
>
}};
BuildOpMap
&
GetGlobalBuildDispatcher
()
{
static
BuildOpMap
build_dispatcher
{
{
TI
(
ngraph
::
op
::
Parameter
),
&
runtime
::
cpu
::
Builder
::
nop
},
{
TI
(
ngraph
::
runtime
::
cpu
::
op
::
ConvertLayout
),
&
runtime
::
cpu
::
Builder
::
build
<
ngraph
::
runtime
::
cpu
::
op
::
ConvertLayout
>
}};
return
build_dispatcher
;
}
REGISTER_OP_BUILDER
(
Constant
);
REGISTER_OP_BUILDER
(
Result
);
...
...
src/ngraph/runtime/cpu/cpu_builder.hpp
View file @
19b2e90a
...
...
@@ -220,8 +220,8 @@
{ \
__register_##OP##_builder() \
{ \
build_dispatcher.insert({type_index(typeid(ngraph::op::OP)),
\
&runtime::cpu::Builder::build<ngraph::op::OP>});
\
GetGlobalBuildDispatcher().insert({type_index(typeid(ngraph::op::OP)),
\
&runtime::cpu::Builder::build<ngraph::op::OP>});
\
} \
} __register_##OP##_builder_instance;
...
...
@@ -239,7 +239,7 @@ namespace ngraph
using
BuildOpMap
=
std
::
unordered_map
<
std
::
type_index
,
BuildOpFunction
>
;
extern
BuildOpMap
build_dispatcher
;
BuildOpMap
&
GetGlobalBuildDispatcher
()
;
class
Builder
{
...
...
src/ngraph/runtime/cpu/cpu_external_function.cpp
View file @
19b2e90a
...
...
@@ -1257,8 +1257,8 @@ void runtime::cpu::CPU_ExternalFunction::build()
}
auto
&
n
=
*
node
;
// Work around a compiler warning (*node inside typeid may have effects
// with shared pointers, which is fine here but clang doesn't like it.)
auto
handler
=
build_dispatcher
.
find
(
type_index
(
typeid
(
n
)));
if
(
handler
==
build_dispatcher
.
end
())
auto
handler
=
GetGlobalBuildDispatcher
()
.
find
(
type_index
(
typeid
(
n
)));
if
(
handler
==
GetGlobalBuildDispatcher
()
.
end
())
{
throw
unsupported_op
(
node
->
description
());
}
...
...
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