Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
aa95521b
"git@developer.sourcefind.cn:gaoqiong/migraphx.git" did not exist on "75ff451363a14d3afb56190fff837da21a5591b2"
Commit
aa95521b
authored
Jun 25, 2018
by
Paul
Browse files
Formatting
parent
5f37fd2d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
29 deletions
+29
-29
src/targets/miopen/include/rtg/miopen/miopen.hpp
src/targets/miopen/include/rtg/miopen/miopen.hpp
+13
-11
src/targets/miopen/miopen_target.cpp
src/targets/miopen/miopen_target.cpp
+12
-15
test/miopen/miopen.cpp
test/miopen/miopen.cpp
+4
-3
No files found.
src/targets/miopen/include/rtg/miopen/miopen.hpp
View file @
aa95521b
...
...
@@ -12,8 +12,8 @@ using miopen_handle = RTG_MANAGE_PTR(miopenHandle_t, miopenDestroy);
using
tensor_descriptor
=
RTG_MANAGE_PTR
(
miopenTensorDescriptor_t
,
miopenDestroyTensorDescriptor
);
using
convolution_descriptor
=
RTG_MANAGE_PTR
(
miopenConvolutionDescriptor_t
,
miopenDestroyConvolutionDescriptor
);
using
pooling_descriptor
=
RTG_MANAGE_PTR
(
miopenPoolingDescriptor_t
,
miopenDestroyPoolingDescriptor
);
using
pooling_descriptor
=
RTG_MANAGE_PTR
(
miopenPoolingDescriptor_t
,
miopenDestroyPoolingDescriptor
);
using
activation_descriptor
=
RTG_MANAGE_PTR
(
miopenActivationDescriptor_t
,
miopenDestroyActivationDescriptor
);
...
...
@@ -60,17 +60,19 @@ inline convolution_descriptor make_conv(const rtg::convolution& op)
inline
pooling_descriptor
make_pooling
(
const
rtg
::
pooling
&
op
)
{
miopenPoolingMode_t
mode
;
if
(
op
.
mode
==
"max"
)
mode
=
miopenPoolingMax
;
else
mode
=
miopenPoolingAverage
;
if
(
op
.
mode
==
"max"
)
mode
=
miopenPoolingMax
;
else
mode
=
miopenPoolingAverage
;
auto
p
=
make_obj
<
pooling_descriptor
>
(
&
miopenCreatePoolingDescriptor
);
miopenSet2dPoolingDescriptor
(
p
.
get
(),
mode
,
op
.
lengths
[
0
],
op
.
lengths
[
1
],
op
.
padding
[
0
],
op
.
padding
[
1
],
op
.
stride
[
0
],
op
.
stride
[
1
]);
mode
,
op
.
lengths
[
0
],
op
.
lengths
[
1
],
op
.
padding
[
0
],
op
.
padding
[
1
],
op
.
stride
[
0
],
op
.
stride
[
1
]);
return
p
;
}
...
...
src/targets/miopen/miopen_target.cpp
View file @
aa95521b
...
...
@@ -78,16 +78,16 @@ struct miopen_pooling
float
alpha
=
1
,
beta
=
0
;
miopenPoolingForward
(
args
[
0
].
implicit
(),
pd
.
get
(),
&
alpha
,
x_desc
.
get
(),
args
[
1
].
implicit
(),
&
beta
,
y_desc
.
get
(),
args
[
2
].
implicit
(),
false
,
nullptr
,
0
);
pd
.
get
(),
&
alpha
,
x_desc
.
get
(),
args
[
1
].
implicit
(),
&
beta
,
y_desc
.
get
(),
args
[
2
].
implicit
(),
false
,
nullptr
,
0
);
return
args
[
2
];
}
...
...
@@ -180,11 +180,8 @@ struct miopen_apply
auto
pd
=
make_pooling
(
op
);
auto
output
=
insert_allocation
(
ins
,
ins
->
result
);
prog
->
replace_instruction
(
ins
,
miopen_pooling
{
op
,
std
::
move
(
pd
)},
handle
,
ins
->
arguments
.
at
(
0
),
output
);
prog
->
replace_instruction
(
ins
,
miopen_pooling
{
op
,
std
::
move
(
pd
)},
handle
,
ins
->
arguments
.
at
(
0
),
output
);
}
void
apply_activation
(
instruction_ref
ins
)
...
...
test/miopen/miopen.cpp
View file @
aa95521b
...
...
@@ -93,7 +93,8 @@ struct test_conv_pooling
}
};
int
main
()
{
verify_program
<
test_conv_relu
>
();
verify_program
<
test_conv_pooling
>
();
int
main
()
{
verify_program
<
test_conv_relu
>
();
verify_program
<
test_conv_pooling
>
();
}
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