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
8c1b643d
Commit
8c1b643d
authored
Nov 08, 2023
by
Paul
Browse files
Format
parent
90911355
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
12 deletions
+6
-12
src/simplify_algebra.cpp
src/simplify_algebra.cpp
+6
-12
No files found.
src/simplify_algebra.cpp
View file @
8c1b643d
...
...
@@ -432,10 +432,7 @@ struct find_add_lit_broadcast
return
match
::
name
(
name
)(
match
::
either_arg
(
0
,
1
)(
op_lit_broadcast
(
name
,
"a"
,
"x"
),
lit_broadcast
().
bind
(
"b"
)));
}
auto
matcher
()
const
{
return
match
::
any_of
(
match_op
(
"add"
),
match_op
(
"mul"
));
}
auto
matcher
()
const
{
return
match
::
any_of
(
match_op
(
"add"
),
match_op
(
"mul"
));
}
void
apply
(
module
&
m
,
const
match
::
matcher_result
&
r
)
const
{
...
...
@@ -457,10 +454,7 @@ struct find_double_add_lit_broadcast
return
match
::
name
(
name
)(
match
::
args
(
op_lit_broadcast
(
name
,
"a"
,
"x"
),
op_lit_broadcast
(
name
,
"b"
,
"y"
)));
}
auto
matcher
()
const
{
return
match
::
any_of
(
match_op
(
"add"
),
match_op
(
"mul"
));
}
auto
matcher
()
const
{
return
match
::
any_of
(
match_op
(
"add"
),
match_op
(
"mul"
));
}
void
apply
(
module
&
m
,
const
match
::
matcher_result
&
r
)
const
{
...
...
@@ -477,8 +471,8 @@ struct find_double_add_lit_broadcast
if
(
a_ins
->
inputs
().
at
(
0
)
->
get_shape
()
!=
b_ins
->
inputs
().
at
(
0
)
->
get_shape
())
return
;
auto
op
=
a_ins
->
get_operator
();
auto
presum
=
m
.
insert_instruction
(
ins
,
op
,
a_ins
->
inputs
().
at
(
0
),
b_ins
->
inputs
().
at
(
0
));
auto
presum
=
m
.
insert_instruction
(
ins
,
op
,
a_ins
->
inputs
().
at
(
0
),
b_ins
->
inputs
().
at
(
0
));
sumab
=
m
.
insert_instruction
(
ins
,
op
,
presum
);
}
else
...
...
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