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
c6d1af4f
Unverified
Commit
c6d1af4f
authored
Apr 16, 2018
by
Robert Kimball
Committed by
GitHub
Apr 16, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove collect_tensor_views and clean up CallFrames (#866)
* remove tensor_call from backends * remove obsolete methods
parent
aadc9ce4
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
8 additions
and
112 deletions
+8
-112
tensor_view.hpp
src/ngraph/descriptor/tensor_view.hpp
+0
-6
cpu_call_frame.cpp
src/ngraph/runtime/cpu/cpu_call_frame.cpp
+3
-23
cpu_call_frame.hpp
src/ngraph/runtime/cpu/cpu_call_frame.hpp
+0
-5
gpu_call_frame.cpp
src/ngraph/runtime/gpu/gpu_call_frame.cpp
+3
-23
gpu_call_frame.hpp
src/ngraph/runtime/gpu/gpu_call_frame.hpp
+0
-5
int_call_frame.cpp
src/ngraph/runtime/interpreter/int_call_frame.cpp
+2
-28
int_call_frame.hpp
src/ngraph/runtime/interpreter/int_call_frame.hpp
+0
-6
tensor_view.cpp
src/ngraph/runtime/tensor_view.cpp
+0
-6
tensor_view.hpp
src/ngraph/runtime/tensor_view.hpp
+0
-3
type.cpp
src/ngraph/type/type.cpp
+0
-6
type.hpp
src/ngraph/type/type.hpp
+0
-1
No files found.
src/ngraph/descriptor/tensor_view.hpp
View file @
c6d1af4f
...
...
@@ -73,12 +73,6 @@ namespace ngraph
m_tensor_view_layout
=
tensor_view_layout
;
}
virtual
void
collect_tensor_views
(
std
::
vector
<
std
::
shared_ptr
<
TensorView
>>&
views
,
const
std
::
shared_ptr
<
TensorView
>&
value
)
const
{
views
.
push_back
(
value
);
}
protected
:
std
::
shared_ptr
<
const
TensorViewType
>
m_tensor_view_type
;
std
::
shared_ptr
<
layout
::
TensorViewLayout
>
m_tensor_view_layout
;
...
...
src/ngraph/runtime/cpu/cpu_call_frame.cpp
View file @
c6d1af4f
...
...
@@ -37,9 +37,9 @@ runtime::cpu::CPU_CallFrame::~CPU_CallFrame()
cleanup_runtime_context
();
}
void
runtime
::
cpu
::
CPU_CallFrame
::
tensor_
call
(
const
std
::
vector
<
std
::
shared_ptr
<
ngraph
::
runtime
::
TensorView
>>&
output_tvs
,
const
std
::
vector
<
std
::
shared_ptr
<
ngraph
::
runtime
::
TensorView
>>&
input_tvs
)
void
runtime
::
cpu
::
CPU_CallFrame
::
call
(
const
std
::
vector
<
std
::
shared_ptr
<
runtime
::
TensorView
>>&
output_tvs
,
const
std
::
vector
<
std
::
shared_ptr
<
runtime
::
TensorView
>>&
input_tvs
)
{
vector
<
void
*>
inputs
;
vector
<
void
*>
outputs
;
...
...
@@ -71,26 +71,6 @@ void runtime::cpu::CPU_CallFrame::tensor_call(
}
}
void
runtime
::
cpu
::
CPU_CallFrame
::
call
(
const
std
::
vector
<
std
::
shared_ptr
<
runtime
::
TensorView
>>&
results
,
const
std
::
vector
<
std
::
shared_ptr
<
runtime
::
TensorView
>>&
arguments
)
{
// TODO: Check types of args and result
vector
<
shared_ptr
<
runtime
::
TensorView
>>
inputs
;
for
(
shared_ptr
<
runtime
::
TensorView
>
argument
:
arguments
)
{
argument
->
collect_tensor_views
(
inputs
,
argument
);
}
vector
<
shared_ptr
<
runtime
::
TensorView
>>
outputs
;
for
(
shared_ptr
<
runtime
::
TensorView
>
result
:
results
)
{
result
->
collect_tensor_views
(
outputs
,
result
);
}
tensor_call
(
outputs
,
inputs
);
}
void
runtime
::
cpu
::
CPU_CallFrame
::
propagate_layouts
(
const
std
::
vector
<
std
::
shared_ptr
<
runtime
::
TensorView
>>&
tvs
,
const
LayoutDescriptorPtrs
&
layouts
)
const
...
...
src/ngraph/runtime/cpu/cpu_call_frame.hpp
View file @
c6d1af4f
...
...
@@ -52,11 +52,6 @@ namespace ngraph
void
call
(
const
std
::
vector
<
std
::
shared_ptr
<
runtime
::
TensorView
>>&
outputs
,
const
std
::
vector
<
std
::
shared_ptr
<
runtime
::
TensorView
>>&
inputs
);
/// @brief Invoke the function with tuples pre-expanded to their underlying
/// tensor views.
void
tensor_call
(
const
std
::
vector
<
std
::
shared_ptr
<
TensorView
>>&
outputs
,
const
std
::
vector
<
std
::
shared_ptr
<
TensorView
>>&
inputs
);
void
propagate_layouts
(
const
std
::
vector
<
std
::
shared_ptr
<
runtime
::
TensorView
>>&
tvs
,
const
LayoutDescriptorPtrs
&
layouts
)
const
;
...
...
src/ngraph/runtime/gpu/gpu_call_frame.cpp
View file @
c6d1af4f
...
...
@@ -42,9 +42,9 @@ runtime::gpu::GPU_CallFrame::~GPU_CallFrame()
cleanup_runtime_context
();
}
void
runtime
::
gpu
::
GPU_CallFrame
::
tensor_
call
(
const
std
::
vector
<
std
::
shared_ptr
<
ngraph
::
runtime
::
TensorView
>>&
output_tvs
,
const
std
::
vector
<
std
::
shared_ptr
<
ngraph
::
runtime
::
TensorView
>>&
input_tvs
)
void
runtime
::
gpu
::
GPU_CallFrame
::
call
(
const
std
::
vector
<
std
::
shared_ptr
<
runtime
::
TensorView
>>&
output_tvs
,
const
std
::
vector
<
std
::
shared_ptr
<
runtime
::
TensorView
>>&
input_tvs
)
{
//Device tensors
vector
<
void
*>
inputs
;
...
...
@@ -66,26 +66,6 @@ void runtime::gpu::GPU_CallFrame::tensor_call(
m_compiled_function
(
inputs
.
data
(),
outputs
.
data
(),
m_external_function
->
m_ctx
.
get
());
}
void
runtime
::
gpu
::
GPU_CallFrame
::
call
(
const
std
::
vector
<
std
::
shared_ptr
<
runtime
::
TensorView
>>&
results
,
const
std
::
vector
<
std
::
shared_ptr
<
runtime
::
TensorView
>>&
arguments
)
{
// TODO: Check types of args and result
vector
<
shared_ptr
<
runtime
::
TensorView
>>
inputs
;
for
(
shared_ptr
<
runtime
::
TensorView
>
argument
:
arguments
)
{
argument
->
collect_tensor_views
(
inputs
,
argument
);
}
vector
<
shared_ptr
<
runtime
::
TensorView
>>
outputs
;
for
(
shared_ptr
<
runtime
::
TensorView
>
result
:
results
)
{
result
->
collect_tensor_views
(
outputs
,
result
);
}
tensor_call
(
outputs
,
inputs
);
}
void
runtime
::
gpu
::
GPU_CallFrame
::
setup_runtime_context
()
{
cublasStatus_t
cublasStatus
=
cublasCreate
(
&
m_cublas_handle
);
...
...
src/ngraph/runtime/gpu/gpu_call_frame.hpp
View file @
c6d1af4f
...
...
@@ -55,11 +55,6 @@ namespace ngraph
void
call
(
const
std
::
vector
<
std
::
shared_ptr
<
runtime
::
TensorView
>>&
outputs
,
const
std
::
vector
<
std
::
shared_ptr
<
runtime
::
TensorView
>>&
inputs
);
/// @brief Invoke the function with tuples pre-expanded to their underlying
/// tensor views.
void
tensor_call
(
const
std
::
vector
<
std
::
shared_ptr
<
TensorView
>>&
outputs
,
const
std
::
vector
<
std
::
shared_ptr
<
TensorView
>>&
inputs
);
void
setup_runtime_context
();
void
cleanup_runtime_context
();
...
...
src/ngraph/runtime/interpreter/int_call_frame.cpp
View file @
c6d1af4f
...
...
@@ -208,14 +208,7 @@ void runtime::interpreter::INT_CallFrame::generate_calls(
}
}
void
runtime
::
interpreter
::
INT_CallFrame
::
tensor_call
(
const
vector
<
shared_ptr
<
runtime
::
HostTensorView
>>&
output_tvs
,
const
vector
<
shared_ptr
<
runtime
::
HostTensorView
>>&
input_tvs
)
{
call
(
m_function
,
output_tvs
,
input_tvs
);
}
void
runtime
::
interpreter
::
INT_CallFrame
::
tensor_call
(
void
runtime
::
interpreter
::
INT_CallFrame
::
call
(
const
vector
<
shared_ptr
<
runtime
::
TensorView
>>&
output_tvs
,
const
vector
<
shared_ptr
<
runtime
::
TensorView
>>&
input_tvs
)
{
...
...
@@ -229,26 +222,7 @@ void runtime::interpreter::INT_CallFrame::tensor_call(
{
out
.
push_back
(
static_pointer_cast
<
runtime
::
HostTensorView
>
(
tv
));
}
tensor_call
(
out
,
args
);
}
void
runtime
::
interpreter
::
INT_CallFrame
::
call
(
const
vector
<
shared_ptr
<
runtime
::
TensorView
>>&
results
,
const
vector
<
shared_ptr
<
runtime
::
TensorView
>>&
arguments
)
{
vector
<
shared_ptr
<
runtime
::
TensorView
>>
inputs
;
for
(
shared_ptr
<
runtime
::
TensorView
>
argument
:
arguments
)
{
argument
->
collect_tensor_views
(
inputs
,
argument
);
}
vector
<
shared_ptr
<
runtime
::
TensorView
>>
outputs
;
for
(
shared_ptr
<
runtime
::
TensorView
>
result
:
results
)
{
result
->
collect_tensor_views
(
outputs
,
result
);
}
tensor_call
(
outputs
,
inputs
);
call
(
m_function
,
out
,
args
);
}
vector
<
runtime
::
PerformanceCounter
>
...
...
src/ngraph/runtime/interpreter/int_call_frame.hpp
View file @
c6d1af4f
...
...
@@ -140,12 +140,6 @@ public:
void
set_nan_check
(
bool
);
private
:
/// @brief Invoke the function with tuples pre-expanded to their underlying
/// tensor views.
void
tensor_call
(
const
std
::
vector
<
std
::
shared_ptr
<
TensorView
>>&
outputs
,
const
std
::
vector
<
std
::
shared_ptr
<
TensorView
>>&
inputs
);
void
tensor_call
(
const
std
::
vector
<
std
::
shared_ptr
<
HostTensorView
>>&
outputs
,
const
std
::
vector
<
std
::
shared_ptr
<
HostTensorView
>>&
inputs
);
void
call
(
std
::
shared_ptr
<
Function
>
function
,
const
std
::
vector
<
std
::
shared_ptr
<
runtime
::
HostTensorView
>>&
output_tvs
,
const
std
::
vector
<
std
::
shared_ptr
<
runtime
::
HostTensorView
>>&
input_tvs
);
...
...
src/ngraph/runtime/tensor_view.cpp
View file @
c6d1af4f
...
...
@@ -32,12 +32,6 @@ shared_ptr<descriptor::TensorView> runtime::TensorView::get_descriptor() const
return
m_descriptor
;
}
void
runtime
::
TensorView
::
collect_tensor_views
(
vector
<
shared_ptr
<
TensorView
>>&
views
,
const
shared_ptr
<
TensorView
>&
value
)
const
{
views
.
push_back
(
value
);
}
const
Shape
&
runtime
::
TensorView
::
get_shape
()
const
{
return
m_descriptor
->
get_tensor_view_type
()
->
get_shape
();
...
...
src/ngraph/runtime/tensor_view.hpp
View file @
c6d1af4f
...
...
@@ -50,9 +50,6 @@ namespace ngraph
virtual
std
::
shared_ptr
<
descriptor
::
TensorView
>
get_descriptor
()
const
;
virtual
void
collect_tensor_views
(
std
::
vector
<
std
::
shared_ptr
<
TensorView
>>&
views
,
const
std
::
shared_ptr
<
TensorView
>&
value
)
const
;
const
ngraph
::
Shape
&
get_shape
()
const
;
const
ngraph
::
Strides
&
get_strides
()
const
;
size_t
get_element_count
()
const
;
...
...
src/ngraph/type/type.cpp
View file @
c6d1af4f
...
...
@@ -46,12 +46,6 @@ bool TensorViewType::operator==(const TensorViewType& that) const
return
rc
;
}
void
TensorViewType
::
collect_tensor_views
(
std
::
vector
<
std
::
shared_ptr
<
const
TensorViewType
>>&
views
)
const
{
views
.
push_back
(
shared_from_this
());
}
std
::
ostream
&
ngraph
::
operator
<<
(
std
::
ostream
&
out
,
const
TensorViewType
&
obj
)
{
out
<<
"TensorViewType("
<<
obj
.
m_element_type
<<
", {"
<<
join
(
obj
.
m_shape
)
<<
"})"
;
...
...
src/ngraph/type/type.hpp
View file @
c6d1af4f
...
...
@@ -44,7 +44,6 @@ namespace ngraph
const
Shape
&
get_shape
()
const
{
return
m_shape
;
}
bool
operator
==
(
const
TensorViewType
&
that
)
const
;
bool
operator
!=
(
const
TensorViewType
&
that
)
const
;
void
collect_tensor_views
(
std
::
vector
<
std
::
shared_ptr
<
const
TensorViewType
>>&
views
)
const
;
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
,
const
TensorViewType
&
);
...
...
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