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
740f5ba1
Commit
740f5ba1
authored
Oct 04, 2018
by
Paul
Browse files
Formatting
parent
e2db5e20
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
src/targets/gpu/fuse_ops.cpp
src/targets/gpu/fuse_ops.cpp
+9
-9
No files found.
src/targets/gpu/fuse_ops.cpp
View file @
740f5ba1
...
@@ -24,23 +24,23 @@ struct hip_add_relu
...
@@ -24,23 +24,23 @@ struct hip_add_relu
struct
match_add_relu
struct
match_add_relu
{
{
auto
matcher
()
const
{
return
match
::
name
(
"gpu::relu"
)(
match
::
args
(
match
::
name
(
"gpu::add"
).
bind
(
"add"
)));
}
auto
matcher
()
const
{
return
match
::
name
(
"gpu::relu"
)(
match
::
args
(
match
::
name
(
"gpu::add"
).
bind
(
"add"
)));
}
void
apply
(
program
&
p
,
match
::
matcher_result
r
)
const
void
apply
(
program
&
p
,
match
::
matcher_result
r
)
const
{
{
auto
add_ins
=
r
.
instructions
[
"add"
];
auto
add_ins
=
r
.
instructions
[
"add"
];
auto
ins
=
r
.
result
;
auto
ins
=
r
.
result
;
auto
args
=
add_ins
->
inputs
();
auto
args
=
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
();
p
.
replace_instruction
(
ins
,
hip_add_relu
{},
args
);
p
.
replace_instruction
(
ins
,
hip_add_relu
{},
args
);
}
}
};
};
void
fuse_ops
::
apply
(
program
&
p
)
const
void
fuse_ops
::
apply
(
program
&
p
)
const
{
match
::
find_matches
(
p
,
match_add_relu
{});
}
{
match
::
find_matches
(
p
,
match_add_relu
{});
}
}
// namespace gpu
}
// namespace gpu
...
...
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