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
49c745bd
Commit
49c745bd
authored
Jul 08, 2019
by
Paul
Browse files
Handle literals in add fusions
parent
a752db35
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
src/simplify_algebra.cpp
src/simplify_algebra.cpp
+3
-1
src/targets/gpu/fuse_ops.cpp
src/targets/gpu/fuse_ops.cpp
+2
-2
No files found.
src/simplify_algebra.cpp
View file @
49c745bd
...
@@ -89,6 +89,8 @@ struct find_add_lit_broadcast
...
@@ -89,6 +89,8 @@ struct find_add_lit_broadcast
void
simplify_algebra
::
apply
(
program
&
p
)
const
void
simplify_algebra
::
apply
(
program
&
p
)
const
{
{
// Run simplifications twice
for
(
int
i
=
0
;
i
<
2
;
i
++
)
match
::
find_matches
(
p
,
find_add_lit_broadcast
{},
find_mul_conv
{});
match
::
find_matches
(
p
,
find_add_lit_broadcast
{},
find_mul_conv
{});
}
}
...
...
src/targets/gpu/fuse_ops.cpp
View file @
49c745bd
...
@@ -225,7 +225,7 @@ struct find_add_relu
...
@@ -225,7 +225,7 @@ struct find_add_relu
return
match
::
name
(
"gpu::relu"
)(
return
match
::
name
(
"gpu::relu"
)(
match
::
arg
(
0
)(
match
::
any_of
(
match
::
name
(
"gpu::add"
),
match
::
arg
(
0
)(
match
::
any_of
(
match
::
name
(
"gpu::add"
),
match
::
name
(
"hip::triadd"
),
match
::
name
(
"hip::triadd"
),
match
::
any_of
[
match
::
inputs
()](
match
::
standard_shape
()))
match
::
any_of
(
match
::
name
(
"@literal"
),
match
::
any_of
[
match
::
inputs
()](
match
::
standard_shape
()))
)
.
bind
(
"add"
)));
.
bind
(
"add"
)));
}
}
...
@@ -252,7 +252,7 @@ struct find_triadd
...
@@ -252,7 +252,7 @@ struct find_triadd
{
{
return
match
::
name
(
"gpu::add"
)(
match
::
either_arg
(
0
,
1
)(
return
match
::
name
(
"gpu::add"
)(
match
::
either_arg
(
0
,
1
)(
match
::
name
(
"gpu::add"
).
bind
(
"add"
),
match
::
name
(
"gpu::add"
).
bind
(
"add"
),
match
::
any
(
match
::
any_of
[
match
::
inputs
()](
match
::
standard_shape
())).
bind
(
"input"
)));
match
::
any
(
match
::
any_of
(
match
::
name
(
"@literal"
),
match
::
any_of
[
match
::
inputs
()](
match
::
standard_shape
()))
)
.
bind
(
"input"
)));
}
}
void
apply
(
program
&
p
,
match
::
matcher_result
r
)
const
void
apply
(
program
&
p
,
match
::
matcher_result
r
)
const
...
...
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