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
8927ccbf
Commit
8927ccbf
authored
May 27, 2019
by
Robert Kimball
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip
parent
9970c680
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
32 deletions
+26
-32
backend.cpp
src/ngraph/runtime/backend.cpp
+9
-10
backend.hpp
src/ngraph/runtime/backend.hpp
+13
-16
tensor.cpp
src/ngraph/runtime/tensor.cpp
+4
-6
No files found.
src/ngraph/runtime/backend.cpp
View file @
8927ccbf
...
...
@@ -119,25 +119,24 @@ runtime::Backend::AsyncEvent::AsyncEvent(size_t buffer_number,
{
}
void
runtime
::
Backend
::
post_async_read_event
(
void
*
p
,
size_t
size_in_bytes
,
size_t
buffer_number
,
std
::
promise
<
void
>&
promise
)
future
<
void
>
runtime
::
Backend
::
post_async_read_event
(
void
*
p
,
size_t
size_in_bytes
,
size_t
buffer_number
)
{
auto
event
=
make_shared
<
AsyncEvent
>
(
AsyncEvent
::
Type
::
READ
,
buffer_number
,
p
,
size_in_bytes
);
m_event_queue
.
post_event
(
event
);
return
event
->
get_future
();
}
void
runtime
::
Backend
::
post_async_write_event
(
const
void
*
p
,
future
<
void
>
runtime
::
Backend
::
post_async_write_event
(
const
void
*
p
,
size_t
size_in_bytes
,
size_t
buffer_number
,
std
::
promise
<
void
>&
promise
)
size_t
buffer_number
)
{
}
void
runtime
::
Backend
::
post_async_execute_event
(
future
<
void
>
runtime
::
Backend
::
post_async_execute_event
(
const
std
::
shared_ptr
<
Executable
>&
executable
,
const
std
::
vector
<
std
::
shared_ptr
<
runtime
::
Tensor
>>&
outputs
,
const
std
::
vector
<
std
::
shared_ptr
<
runtime
::
Tensor
>>&
inputs
,
size_t
buffer_number
,
std
::
promise
<
void
>&
promise
)
size_t
buffer_number
)
{
}
src/ngraph/runtime/backend.hpp
View file @
8927ccbf
...
...
@@ -153,6 +153,11 @@ protected:
WRITE
,
EXECUTE
};
AsyncEvent
(
Type
type
,
size_t
buffer_number
,
void
*
p
,
size_t
size_in_bytes
);
AsyncEvent
(
size_t
buffer_number
,
const
std
::
shared_ptr
<
Executable
>&
m_executable
,
const
std
::
vector
<
std
::
shared_ptr
<
runtime
::
Tensor
>>&
m_outputs
,
const
std
::
vector
<
std
::
shared_ptr
<
runtime
::
Tensor
>>&
m_inputs
);
void
*
get_data
()
const
{
return
m_data
;
}
bool
get_size_in_bytes
()
const
{
return
m_size_in_bytes
;
}
Type
get_type
()
const
{
return
m_type
;
}
...
...
@@ -162,12 +167,8 @@ protected:
return
m_outputs
;
}
const
std
::
vector
<
std
::
shared_ptr
<
runtime
::
Tensor
>>*
get_inputs
()
const
{
return
m_inputs
;
}
std
::
future
<
void
>
get_future
()
{
return
m_promise
.
get_future
();
}
private
:
AsyncEvent
(
Type
type
,
size_t
buffer_number
,
void
*
p
,
size_t
size_in_bytes
);
AsyncEvent
(
size_t
buffer_number
,
const
std
::
shared_ptr
<
Executable
>&
m_executable
,
const
std
::
vector
<
std
::
shared_ptr
<
runtime
::
Tensor
>>&
m_outputs
,
const
std
::
vector
<
std
::
shared_ptr
<
runtime
::
Tensor
>>&
m_inputs
);
const
Type
m_type
;
size_t
m_buffer_number
;
void
*
m_data
;
...
...
@@ -175,19 +176,15 @@ protected:
std
::
shared_ptr
<
Executable
>
m_executable
;
const
std
::
vector
<
std
::
shared_ptr
<
runtime
::
Tensor
>>*
m_outputs
;
const
std
::
vector
<
std
::
shared_ptr
<
runtime
::
Tensor
>>*
m_inputs
;
std
::
promise
<
void
>
m_promise
;
};
void
post_async_read_event
(
void
*
p
,
size_t
size_in_bytes
,
size_t
buffer_number
,
std
::
promise
<
void
>&
promise
);
void
post_async_write_event
(
const
void
*
p
,
size_t
size_in_bytes
,
size_t
buffer_number
,
std
::
promise
<
void
>&
promise
);
void
post_async_execute_event
(
const
std
::
shared_ptr
<
Executable
>&
executable
,
std
::
future
<
void
>
post_async_read_event
(
void
*
p
,
size_t
size_in_bytes
,
size_t
buffer_number
);
std
::
future
<
void
>
post_async_write_event
(
const
void
*
p
,
size_t
size_in_bytes
,
size_t
buffer_number
);
std
::
future
<
void
>
post_async_execute_event
(
const
std
::
shared_ptr
<
Executable
>&
executable
,
const
std
::
vector
<
std
::
shared_ptr
<
runtime
::
Tensor
>>&
outputs
,
const
std
::
vector
<
std
::
shared_ptr
<
runtime
::
Tensor
>>&
inputs
,
size_t
buffer_number
,
std
::
promise
<
void
>&
promise
);
size_t
buffer_number
);
};
src/ngraph/runtime/tensor.cpp
View file @
8927ccbf
...
...
@@ -102,9 +102,8 @@ future<void> runtime::Tensor::begin_write(const void* p, size_t size_in_bytes, s
{
if
(
m_backend
)
{
auto
f
=
m_promise
.
get_future
();
m_backend
->
post_async_write_event
(
p
,
size_in_bytes
,
buffer_number
,
m_promise
);
return
f
;
// auto f = m_promise.get_future();
return
m_backend
->
post_async_write_event
(
p
,
size_in_bytes
,
buffer_number
);
}
else
{
...
...
@@ -121,9 +120,8 @@ future<void> runtime::Tensor::begin_read(void* p, size_t size_in_bytes, size_t b
{
if
(
m_backend
)
{
auto
f
=
m_promise
.
get_future
();
m_backend
->
post_async_read_event
(
p
,
size_in_bytes
,
buffer_number
,
m_promise
);
return
f
;
// auto f = m_promise.get_future();
return
m_backend
->
post_async_read_event
(
p
,
size_in_bytes
,
buffer_number
);
}
else
{
...
...
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