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
7489c75d
Commit
7489c75d
authored
Aug 01, 2019
by
Paul
Browse files
Formatting
parent
cb9bfaf4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
12 deletions
+13
-12
src/targets/gpu/device/add_relu.cpp
src/targets/gpu/device/add_relu.cpp
+5
-5
src/targets/gpu/fuse_ops.cpp
src/targets/gpu/fuse_ops.cpp
+4
-3
src/targets/gpu/include/migraphx/gpu/device/add_relu.hpp
src/targets/gpu/include/migraphx/gpu/device/add_relu.hpp
+4
-4
No files found.
src/targets/gpu/device/add_relu.cpp
View file @
7489c75d
...
@@ -7,13 +7,13 @@ namespace gpu {
...
@@ -7,13 +7,13 @@ namespace gpu {
namespace
device
{
namespace
device
{
void
mul_add_relu
(
hipStream_t
stream
,
void
mul_add_relu
(
hipStream_t
stream
,
const
argument
&
result
,
const
argument
&
result
,
const
argument
&
arg1
,
const
argument
&
arg1
,
const
argument
&
arg2
,
const
argument
&
arg2
,
const
argument
&
arg3
)
const
argument
&
arg3
)
{
{
nary
(
stream
,
result
,
arg1
,
arg2
,
arg3
)(
nary
(
stream
,
result
,
arg1
,
arg2
,
arg3
)(
[](
auto
x
,
auto
a
,
auto
b
)
{
return
std
::
max
<
decltype
(
a
*
x
+
b
)
>
(
0
,
a
*
x
+
b
);
});
[](
auto
x
,
auto
a
,
auto
b
)
{
return
std
::
max
<
decltype
(
a
*
x
+
b
)
>
(
0
,
a
*
x
+
b
);
});
}
}
void
add_relu
(
hipStream_t
stream
,
void
add_relu
(
hipStream_t
stream
,
...
...
src/targets/gpu/fuse_ops.cpp
View file @
7489c75d
...
@@ -230,7 +230,8 @@ struct hip_mul_add_relu
...
@@ -230,7 +230,8 @@ struct hip_mul_add_relu
}
}
argument
compute
(
context
&
ctx
,
const
shape
&
,
const
std
::
vector
<
argument
>&
args
)
const
argument
compute
(
context
&
ctx
,
const
shape
&
,
const
std
::
vector
<
argument
>&
args
)
const
{
{
device
::
mul_add_relu
(
ctx
.
get_stream
().
get
(),
args
.
at
(
3
),
args
.
at
(
0
),
args
.
at
(
1
),
args
.
at
(
2
));
device
::
mul_add_relu
(
ctx
.
get_stream
().
get
(),
args
.
at
(
3
),
args
.
at
(
0
),
args
.
at
(
1
),
args
.
at
(
2
));
return
args
.
at
(
3
);
return
args
.
at
(
3
);
}
}
std
::
ptrdiff_t
output_alias
(
const
std
::
vector
<
shape
>&
shapes
)
const
std
::
ptrdiff_t
output_alias
(
const
std
::
vector
<
shape
>&
shapes
)
const
...
@@ -354,8 +355,8 @@ struct find_mul_add_relu
...
@@ -354,8 +355,8 @@ struct find_mul_add_relu
void
apply
(
program
&
p
,
match
::
matcher_result
r
)
const
void
apply
(
program
&
p
,
match
::
matcher_result
r
)
const
{
{
auto
mul_add_ins
=
r
.
instructions
[
"mul_add"
];
auto
mul_add_ins
=
r
.
instructions
[
"mul_add"
];
auto
ins
=
r
.
result
;
auto
ins
=
r
.
result
;
auto
args
=
mul_add_ins
->
inputs
();
auto
args
=
mul_add_ins
->
inputs
();
// Use the allocation from the relu operator
// Use the allocation from the relu operator
args
.
back
()
=
ins
->
inputs
().
back
();
args
.
back
()
=
ins
->
inputs
().
back
();
...
...
src/targets/gpu/include/migraphx/gpu/device/add_relu.hpp
View file @
7489c75d
...
@@ -12,10 +12,10 @@ namespace gpu {
...
@@ -12,10 +12,10 @@ namespace gpu {
namespace
device
{
namespace
device
{
void
mul_add_relu
(
hipStream_t
stream
,
void
mul_add_relu
(
hipStream_t
stream
,
const
argument
&
result
,
const
argument
&
result
,
const
argument
&
arg1
,
const
argument
&
arg1
,
const
argument
&
arg2
,
const
argument
&
arg2
,
const
argument
&
arg3
);
const
argument
&
arg3
);
void
add_relu
(
hipStream_t
stream
,
void
add_relu
(
hipStream_t
stream
,
const
argument
&
result
,
const
argument
&
result
,
...
...
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