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
92adea38
Commit
92adea38
authored
Aug 01, 2018
by
shssf
Committed by
Scott Cyphers
Aug 01, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IntelGPU backend: Sum and redeveloped Broadcast operation (#1276)
parent
cb84305e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
77 additions
and
5 deletions
+77
-5
intelgpu_backend.cpp
src/ngraph/runtime/intelgpu/intelgpu_backend.cpp
+61
-2
intelgpu_op_broadcast.cpp
src/ngraph/runtime/intelgpu/intelgpu_op_broadcast.cpp
+0
-0
intelgpu_op_broadcast.hpp
src/ngraph/runtime/intelgpu/intelgpu_op_broadcast.hpp
+16
-3
No files found.
src/ngraph/runtime/intelgpu/intelgpu_backend.cpp
View file @
92adea38
...
...
@@ -289,6 +289,8 @@ bool runtime::intelgpu::IntelGPUBackend::compile(shared_ptr<Function> func)
const
string
&
output_name
=
op
->
get_outputs
().
begin
()
->
get_tensor
().
get_name
();
const
Shape
&
output_shape
=
op
->
get_outputs
().
begin
()
->
get_shape
();
const
element
::
Type
&
output_type
=
op
->
get_outputs
().
begin
()
->
get_tensor
().
get_element_type
();
const
shared_ptr
<
op
::
Broadcast
>
broadcast
=
static_pointer_cast
<
op
::
Broadcast
>
(
op
);
const
AxisSet
&
axis
=
broadcast
->
get_broadcast_axes
();
...
...
@@ -297,10 +299,67 @@ bool runtime::intelgpu::IntelGPUBackend::compile(shared_ptr<Function> func)
{
do_equal_propagation
(
topology
,
input_name
,
output_name
);
}
else
if
(
input_shape
.
empty
())
{
do_bcast_sum_operation_scalar
(
topology
,
input_name
,
input_shape
,
output_name
,
output_shape
,
output_type
,
true
);
}
else
{
do_bcast_sum_operation
(
topology
,
input_name
,
input_shape
,
output_name
,
output_shape
,
output_type
,
axis
,
true
);
}
}
else
if
(
"Sum"
==
op
->
description
())
{
arguments_check
(
op
,
1
,
1
);
const
string
&
input_name
=
op
->
get_inputs
().
begin
()
->
get_tensor
().
get_name
();
const
Shape
&
input_shape
=
op
->
get_inputs
().
begin
()
->
get_shape
();
const
string
&
output_name
=
op
->
get_outputs
().
begin
()
->
get_tensor
().
get_name
();
const
Shape
&
output_shape
=
op
->
get_outputs
().
begin
()
->
get_shape
();
const
element
::
Type
&
output_type
=
op
->
get_outputs
().
begin
()
->
get_tensor
().
get_element_type
();
const
shared_ptr
<
op
::
Sum
>
sum
=
static_pointer_cast
<
op
::
Sum
>
(
op
);
const
AxisSet
&
axis
=
sum
->
get_reduction_axes
();
if
(
axis
.
empty
())
{
do_equal_propagation
(
topology
,
input_name
,
output_name
);
}
else
if
(
output_shape
.
empty
())
{
do_bcast_sum_operation_scalar
(
topology
,
input_name
,
input_shape
,
output_name
,
output_shape
,
output_type
,
false
);
}
else
{
do_broadcast_operation
(
topology
,
input_name
,
input_shape
,
output_name
,
output_shape
,
axis
);
do_bcast_sum_operation
(
topology
,
input_name
,
input_shape
,
output_name
,
output_shape
,
output_type
,
axis
,
false
);
}
}
else
if
(
"Reshape"
==
op
->
description
())
...
...
src/ngraph/runtime/intelgpu/intelgpu_op_broadcast.cpp
View file @
92adea38
This diff is collapsed.
Click to expand it.
src/ngraph/runtime/intelgpu/intelgpu_op_broadcast.hpp
View file @
92adea38
...
...
@@ -27,13 +27,26 @@ namespace ngraph
{
namespace
intelgpu
{
// This implements Broadcast nGraph operation
void
do_broadcast_operation
(
cldnn
::
topology
&
topology
,
// This implements Broadcast and Sum nGraph operations
// in case of input_shape is not empty
void
do_bcast_sum_operation
(
cldnn
::
topology
&
topology
,
const
std
::
string
&
input_name
,
const
Shape
&
input_shape
,
const
std
::
string
&
output_name
,
const
Shape
&
output_shape
,
const
AxisSet
&
axis
);
const
element
::
Type
&
output_type
,
const
AxisSet
&
axis
,
bool
is_bcast
);
// This implements Broadcast and Sum nGraph operations
// in case of input_shape is empty
void
do_bcast_sum_operation_scalar
(
cldnn
::
topology
&
topology
,
const
std
::
string
&
input_name
,
const
Shape
&
input_shape
,
const
std
::
string
&
output_name
,
const
Shape
&
output_shape
,
const
element
::
Type
&
output_type
,
bool
is_bcast
);
}
}
}
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