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
b26c0e38
Commit
b26c0e38
authored
Jul 23, 2019
by
Robert Kimball
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup
parent
a5e7fdbc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
benchmark_pipelined.cpp
src/tools/nbench/benchmark_pipelined.cpp
+11
-6
No files found.
src/tools/nbench/benchmark_pipelined.cpp
View file @
b26c0e38
...
...
@@ -47,6 +47,7 @@ static condition_variable s_condition;
static
size_t
current_iteration
=
0
;
static
size_t
s_iterations
;
static
size_t
s_warmup_iterations
;
static
stopwatch
s_timer
;
static
void
thread_entry
(
runtime
::
Executable
*
exec
,
const
TensorCollection
&
tensors
,
size_t
pipeline_stage
)
...
...
@@ -77,9 +78,15 @@ static void
}
else
{
if
(
current_iteration
==
s_warmup_iterations
)
{
s_timer
.
start
();
}
// our turn to run
NGRAPH_INFO
<<
"stage "
<<
pipeline_stage
<<
" for iteration "
<<
current_iteration
;
exec
->
call
(
results
,
args
);
current_iteration
++
;
data_written
=
false
;
s_condition
.
notify_all
();
for
(
size_t
result_index
=
0
;
result_index
<
results
.
size
();
result_index
++
)
{
const
shared_ptr
<
runtime
::
HostTensor
>&
data
=
tensors
.
result_data
[
result_index
];
...
...
@@ -87,9 +94,6 @@ static void
result
->
read
(
data
->
get_data_ptr
(),
data
->
get_element_count
()
*
data
->
get_element_type
().
size
());
}
current_iteration
++
;
data_written
=
false
;
s_condition
.
notify_all
();
}
}
}
...
...
@@ -161,8 +165,6 @@ vector<runtime::PerformanceCounter> run_benchmark_pipelined(shared_ptr<Function>
}
}
stopwatch
t1
;
size_t
current_iteration
=
0
;
thread
threads
[
pipeline_depth
];
for
(
size_t
i
=
0
;
i
<
pipeline_depth
;
i
++
)
...
...
@@ -174,6 +176,9 @@ vector<runtime::PerformanceCounter> run_benchmark_pipelined(shared_ptr<Function>
{
threads
[
i
].
join
();
}
s_timer
.
stop
();
float
time
=
s_timer
.
get_milliseconds
();
cout
<<
time
/
iterations
<<
"ms per iteration"
<<
endl
;
vector
<
runtime
::
PerformanceCounter
>
perf_data
=
exec
->
get_performance_data
();
return
perf_data
;
...
...
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