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
f534650d
Commit
f534650d
authored
Aug 01, 2018
by
dmyershov
Committed by
Robert Kimball
Aug 01, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IntelGPU backend: Convolution operation (#1285)
parent
6bca3efd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
0 deletions
+63
-0
intelgpu_backend.cpp
src/ngraph/runtime/intelgpu/intelgpu_backend.cpp
+63
-0
No files found.
src/ngraph/runtime/intelgpu/intelgpu_backend.cpp
View file @
f534650d
...
...
@@ -426,6 +426,69 @@ bool runtime::intelgpu::IntelGPUBackend::compile(shared_ptr<Function> func)
arguments_check
(
op
,
5
,
1
);
// throw exception in this case
}
}
else
if
(
"Convolution"
==
op
->
description
())
{
arguments_check
(
op
,
2
,
1
);
const
std
::
string
&
conv_name
=
op
->
get_outputs
().
begin
()
->
get_tensor
().
get_name
();
const
std
::
string
&
image_name
=
op
->
get_inputs
().
at
(
0
).
get_tensor
().
get_name
();
const
std
::
string
&
weight_name
=
op
->
get_inputs
().
at
(
1
).
get_tensor
().
get_name
();
const
shared_ptr
<
op
::
Convolution
>
conv_op
=
static_pointer_cast
<
op
::
Convolution
>
(
op
);
const
Strides
&
conv_stride
=
conv_op
->
get_window_movement_strides
();
const
Strides
&
conv_dilation
=
conv_op
->
get_window_dilation_strides
();
const
CoordinateDiff
&
conv_padding_below
=
conv_op
->
get_padding_below
();
const
CoordinateDiff
&
conv_padding_above
=
conv_op
->
get_padding_above
();
const
Strides
&
conv_data_dilation
=
conv_op
->
get_data_dilation_strides
();
if
(
conv_stride
.
size
()
>
2
)
{
ostringstream
os
;
os
<<
"Unsupported strides for
\"
"
<<
op
->
description
()
<<
'\"'
;
throw
std
::
invalid_argument
(
os
.
str
());
}
if
(
conv_padding_below
.
size
()
>
2
||
conv_padding_above
.
size
()
>
2
)
{
ostringstream
os
;
os
<<
"Unsupported padding for
\"
"
<<
op
->
description
()
<<
'\"'
;
throw
std
::
invalid_argument
(
os
.
str
());
}
//TODO: Further clDNN version will work with different paddings above and below
if
(
conv_padding_below
.
at
(
0
)
!=
conv_padding_above
.
at
(
0
)
||
conv_padding_below
.
at
(
1
)
!=
conv_padding_above
.
at
(
1
))
{
ostringstream
os
;
os
<<
"Paddings above and below are different for
\"
"
<<
op
->
description
()
<<
'\"'
;
throw
std
::
invalid_argument
(
os
.
str
());
}
if
(
conv_dilation
.
size
()
>
2
)
{
ostringstream
os
;
os
<<
"Unsupported dilation for
\"
"
<<
op
->
description
()
<<
'\"'
;
throw
std
::
invalid_argument
(
os
.
str
());
}
if
(
conv_data_dilation
.
size
()
>
2
||
conv_data_dilation
.
at
(
0
)
!=
1
||
conv_data_dilation
.
at
(
1
)
!=
1
)
{
ostringstream
os
;
os
<<
"Unsupported data dilation for
\"
"
<<
op
->
description
()
<<
'\"'
;
throw
std
::
invalid_argument
(
os
.
str
());
}
const
cldnn
::
tensor
input_offset
(
0
,
0
,
-
conv_padding_below
.
at
(
1
),
-
conv_padding_below
.
at
(
0
));
const
cldnn
::
tensor
strides
(
1
,
1
,
conv_stride
.
at
(
1
),
conv_stride
.
at
(
0
));
const
cldnn
::
tensor
dilation
(
1
,
1
,
conv_dilation
.
at
(
1
),
conv_dilation
.
at
(
0
));
const
cldnn
::
convolution
cldnn_conv
(
conv_name
,
image_name
,
{
weight_name
},
strides
,
input_offset
,
dilation
);
topology
.
add
(
cldnn_conv
);
}
else
{
ostringstream
os
;
...
...
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