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
2fa3e1a8
Commit
2fa3e1a8
authored
Mar 29, 2018
by
Robert Kimball
Committed by
Adam Procter
Mar 29, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove static vector when finding known nodes (#789)
parent
324efb18
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
17 deletions
+10
-17
benchmark.cpp
test/util/benchmark.cpp
+10
-17
No files found.
test/util/benchmark.cpp
View file @
2fa3e1a8
...
...
@@ -30,32 +30,25 @@
using
namespace
std
;
using
namespace
ngraph
;
shared_ptr
<
Node
>
find_node
(
const
string
&
name
,
shared_ptr
<
Function
>
func
)
multimap
<
size_t
,
string
>
aggregate_timing_details
(
const
vector
<
runtime
::
PerformanceCounter
>&
perf_data
,
shared_ptr
<
Function
>
func
)
{
static
unordered_map
<
string
,
shared_ptr
<
Node
>>
node_map
;
if
(
node_map
.
empty
())
unordered_map
<
string
,
shared_ptr
<
Node
>>
node_map
;
vector
<
shared_ptr
<
Function
>>
fs
;
traverse_functions
(
func
,
[
&
](
shared_ptr
<
Function
>
f
)
{
fs
.
push_back
(
f
);
});
for
(
shared_ptr
<
Function
>
f
:
fs
)
{
vector
<
shared_ptr
<
Function
>>
fs
;
traverse_functions
(
func
,
[
&
](
shared_ptr
<
Function
>
f
)
{
fs
.
push_back
(
f
);
});
for
(
shared_ptr
<
Function
>
f
:
fs
)
for
(
shared_ptr
<
Node
>
node
:
f
->
get_ops
())
{
for
(
shared_ptr
<
Node
>
node
:
f
->
get_ops
())
{
node_map
.
insert
({
node
->
get_name
(),
node
});
}
node_map
.
insert
({
node
->
get_name
(),
node
});
}
}
return
node_map
[
name
];
}
multimap
<
size_t
,
string
>
aggregate_timing_details
(
const
vector
<
runtime
::
PerformanceCounter
>&
perf_data
,
shared_ptr
<
Function
>
f
)
{
unordered_map
<
string
,
size_t
>
timing
;
for
(
const
runtime
::
PerformanceCounter
&
p
:
perf_data
)
{
shared_ptr
<
Node
>
node
=
find_node
(
p
.
name
(),
f
);
shared_ptr
<
Node
>
node
=
node_map
.
at
(
p
.
name
()
);
string
op
=
p
.
name
().
substr
(
0
,
p
.
name
().
find
(
'_'
));
string
shape_name
=
"{"
+
join
(
node
->
get_outputs
()[
0
].
get_shape
())
+
"}"
;
timing
[
op
+
shape_name
]
+=
p
.
microseconds
();
...
...
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