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
8dfd08e1
"...include/git@developer.sourcefind.cn:gaoqiong/migraphx.git" did not exist on "9ace3b74d2cef40f10969e692d5e94e689fb5404"
Commit
8dfd08e1
authored
Oct 02, 2022
by
Paul
Browse files
Format
parent
632b5f9b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
13 deletions
+7
-13
src/simplify_algebra.cpp
src/simplify_algebra.cpp
+7
-13
No files found.
src/simplify_algebra.cpp
View file @
8dfd08e1
...
...
@@ -777,30 +777,24 @@ struct find_add_split
{
auto
matcher
()
const
{
auto
add
=
[](
auto
...
ms
)
{
return
match
::
name
(
"add"
)(
match
::
either_arg
(
0
,
1
)(
ms
...));
};
auto
add
=
[](
auto
...
ms
)
{
return
match
::
name
(
"add"
)(
match
::
either_arg
(
0
,
1
)(
ms
...));
};
auto
slice
=
match
::
name
(
"slice"
).
bind
(
"slice"
);
auto
constant
=
match
::
is_constant
().
bind
(
"a"
);
auto
any
=
match
::
any
().
bind
(
"x"
);
auto
constant
=
match
::
is_constant
().
bind
(
"a"
);
auto
any
=
match
::
any
().
bind
(
"x"
);
auto
slice_a_x
=
add
(
slice
,
add
(
constant
,
any
));
auto
a_slice_x
=
add
(
constant
,
add
(
slice
,
any
));
return
match
::
any_of
(
slice_a_x
,
a_slice_x
);
return
match
::
any_of
(
slice_a_x
,
a_slice_x
);
}
void
apply
(
module
&
m
,
const
match
::
matcher_result
&
r
)
const
{
auto
ins
=
r
.
result
;
auto
ins
=
r
.
result
;
auto
slice
=
r
.
instructions
[
"slice"
];
auto
a
=
r
.
instructions
[
"a"
];
auto
x
=
r
.
instructions
[
"x"
];
auto
a
=
r
.
instructions
[
"a"
];
auto
x
=
r
.
instructions
[
"x"
];
auto
slice_add
=
m
.
insert_instruction
(
ins
,
migraphx
::
make_op
(
"add"
),
slice
,
a
);
m
.
replace_instruction
(
ins
,
migraphx
::
make_op
(
"add"
),
slice_add
,
x
);
}
};
...
...
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