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
8423d683
"lightx2v/git@developer.sourcefind.cn:Wenxuan/LightX2V.git" did not exist on "b7d2d43f01e1b61c20c80d6943723ba1752c91bf"
Commit
8423d683
authored
Jan 25, 2023
by
Paul
Browse files
Format
parent
7da12e6e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
12 deletions
+14
-12
src/fuse_reduce.cpp
src/fuse_reduce.cpp
+14
-12
No files found.
src/fuse_reduce.cpp
View file @
8423d683
...
@@ -218,13 +218,14 @@ struct find_pointwise_reduce
...
@@ -218,13 +218,14 @@ struct find_pointwise_reduce
struct
find_reduce_pointwise
struct
find_reduce_pointwise
{
{
template
<
class
...
Ms
>
template
<
class
...
Ms
>
static
auto
match_broadcast
(
Ms
...
ms
)
static
auto
match_broadcast
(
Ms
...
ms
)
{
{
return
match
::
skip
(
match
::
name
(
"contiguous"
))(
match
::
name
(
"multibroadcast"
)(
match
::
arg
(
0
)(
ms
...)).
bind
(
"broadcast"
));
return
match
::
skip
(
match
::
name
(
"contiguous"
))(
match
::
name
(
"multibroadcast"
)(
match
::
arg
(
0
)(
ms
...)).
bind
(
"broadcast"
));
}
}
template
<
class
...
Ms
>
template
<
class
...
Ms
>
static
auto
any_input
(
Ms
...
ms
)
static
auto
any_input
(
Ms
...
ms
)
{
{
return
match
::
any_of
[
match
::
inputs
()](
match
::
any
(
ms
...).
bind
(
"input"
));
return
match
::
any_of
[
match
::
inputs
()](
match
::
any
(
ms
...).
bind
(
"input"
));
...
@@ -283,7 +284,7 @@ struct find_reduce_reduce
...
@@ -283,7 +284,7 @@ struct find_reduce_reduce
auto
reduce1
=
r
.
result
;
auto
reduce1
=
r
.
result
;
auto
reduce2
=
r
.
instructions
[
"reduce"
];
auto
reduce2
=
r
.
instructions
[
"reduce"
];
if
(
reduce1
->
get_operator
()
!=
reduce2
->
get_operator
())
if
(
reduce1
->
get_operator
()
!=
reduce2
->
get_operator
())
return
;
return
;
const
auto
*
rm1
=
reduce1
->
module_inputs
().
front
();
const
auto
*
rm1
=
reduce1
->
module_inputs
().
front
();
...
@@ -310,9 +311,10 @@ void fuse_reduce::apply(module_pass_manager& mpm) const
...
@@ -310,9 +311,10 @@ void fuse_reduce::apply(module_pass_manager& mpm) const
{
{
create_reduce_modules
(
mpm
);
create_reduce_modules
(
mpm
);
mpm
.
run_pass
(
dead_code_elimination
{});
mpm
.
run_pass
(
dead_code_elimination
{});
for
(
int
i
=
0
;
i
<
4
;
i
++
)
for
(
int
i
=
0
;
i
<
4
;
i
++
)
{
{
match
::
find_matches
(
mpm
,
find_reduce_pointwise
{},
find_pointwise_reduce
{},
find_reduce_reduce
{});
match
::
find_matches
(
mpm
,
find_reduce_pointwise
{},
find_pointwise_reduce
{},
find_reduce_reduce
{});
mpm
.
run_pass
(
dead_code_elimination
{});
mpm
.
run_pass
(
dead_code_elimination
{});
}
}
}
}
...
...
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