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
0bb34c03
Commit
0bb34c03
authored
Jul 21, 2019
by
Robert Kimball
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runs all iterations
parent
ef893111
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
11 deletions
+23
-11
benchmark_pipelined.cpp
src/tools/nbench/benchmark_pipelined.cpp
+23
-11
No files found.
src/tools/nbench/benchmark_pipelined.cpp
View file @
0bb34c03
...
...
@@ -44,23 +44,33 @@ private:
static
mutex
s_mutex
;
static
condition_variable
s_condition
;
static
size_t
current_iteration
=
0
;
static
size_t
s_iterations
;
static
size_t
s_warmup_iterations
;
static
void
do_iteration
(
runtime
::
Executable
*
exec
,
const
TensorCollection
&
tensors
)
{
}
static
void
thread_entry
(
runtime
::
Executable
*
exec
,
const
TensorCollection
&
tensors
,
size_t
pipeline_stage
)
// static void thread_entry(size_t pipeline_stage)
{
NGRAPH_INFO
;
unique_lock
<
mutex
>
lock
(
s_mutex
);
if
((
current_iteration
&
1
)
!=
pipeline_stage
)
{
s_condition
.
wait
(
lock
);
}
else
while
(
current_iteration
<
s_iterations
+
s_warmup_iterations
)
{
// our turn to run
NGRAPH_INFO
<<
"stage "
<<
pipeline_stage
<<
" for iteration "
<<
current_iteration
;
current_iteration
++
;
s_condition
.
notify_all
();
NGRAPH_INFO
;
unique_lock
<
mutex
>
lock
(
s_mutex
);
if
((
current_iteration
&
1
)
!=
pipeline_stage
)
{
s_condition
.
wait
(
lock
);
}
else
{
// our turn to run
NGRAPH_INFO
<<
"stage "
<<
pipeline_stage
<<
" for iteration "
<<
current_iteration
;
do_iteration
(
exec
,
tensors
);
current_iteration
++
;
s_condition
.
notify_all
();
}
}
}
...
...
@@ -73,6 +83,8 @@ vector<runtime::PerformanceCounter> run_benchmark_pipelined(shared_ptr<Function>
{
NGRAPH_INFO
;
constexpr
size_t
pipeline_depth
=
2
;
s_iterations
=
iterations
;
s_warmup_iterations
=
warmup_iterations
;
array
<
TensorCollection
,
pipeline_depth
>
tensor_collections
;
stopwatch
timer
;
timer
.
start
();
...
...
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