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
8b768fee
Commit
8b768fee
authored
Jul 15, 2019
by
Robert Kimball
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pull from a different branch
parent
a58d3bc2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
2 deletions
+25
-2
benchmark.cpp
src/tools/nbench/benchmark.cpp
+0
-0
benchmark.hpp
src/tools/nbench/benchmark.hpp
+8
-0
nbench.cpp
src/tools/nbench/nbench.cpp
+17
-2
No files found.
src/tools/nbench/benchmark.cpp
View file @
8b768fee
This diff is collapsed.
Click to expand it.
src/tools/nbench/benchmark.hpp
View file @
8b768fee
...
...
@@ -34,3 +34,11 @@ std::vector<ngraph::runtime::PerformanceCounter> run_benchmark(std::shared_ptr<n
bool
timing_detail
,
int
warmup_iterations
,
bool
copy_data
);
std
::
vector
<
ngraph
::
runtime
::
PerformanceCounter
>
run_benchmark_double_buffered
(
std
::
shared_ptr
<
ngraph
::
Function
>
f
,
const
std
::
string
&
backend_name
,
size_t
iterations
,
bool
timing_detail
,
int
warmup_iterations
,
bool
copy_data
);
src/tools/nbench/nbench.cpp
View file @
8b768fee
...
...
@@ -181,6 +181,7 @@ int main(int argc, char** argv)
int
warmup_iterations
=
1
;
bool
copy_data
=
true
;
bool
dot_file
=
false
;
bool
double_buffer
=
false
;
for
(
size_t
i
=
1
;
i
<
argc
;
i
++
)
{
...
...
@@ -229,6 +230,10 @@ int main(int argc, char** argv)
{
directory
=
argv
[
++
i
];
}
else
if
(
arg
==
"--double_buffer"
)
{
double_buffer
=
true
;
}
else
if
(
arg
==
"-w"
||
arg
==
"--warmup_iterations"
)
{
try
...
...
@@ -283,6 +288,7 @@ OPTIONS
-w|--warmup_iterations Number of warm-up iterations
--no_copy_data Disable copy of input/result data every iteration
--dot Generate Graphviz dot file
--double_buffer Double buffer inputs and outputs
)###"
;
return
1
;
}
...
...
@@ -420,8 +426,17 @@ OPTIONS
{
cout
<<
"
\n
---- Benchmark ----
\n
"
;
shared_ptr
<
Function
>
f
=
deserialize
(
model
);
auto
perf_data
=
run_benchmark
(
f
,
backend
,
iterations
,
timing_detail
,
warmup_iterations
,
copy_data
);
vector
<
runtime
::
PerformanceCounter
>
perf_data
;
if
(
double_buffer
)
{
perf_data
=
run_benchmark_double_buffered
(
f
,
backend
,
iterations
,
timing_detail
,
warmup_iterations
,
copy_data
);
}
else
{
perf_data
=
run_benchmark
(
f
,
backend
,
iterations
,
timing_detail
,
warmup_iterations
,
copy_data
);
}
auto
perf_shape
=
to_perf_shape
(
f
,
perf_data
);
aggregate_perf_data
.
insert
(
aggregate_perf_data
.
end
(),
perf_shape
.
begin
(),
perf_shape
.
end
());
...
...
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