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
5d998fb2
"vscode:/vscode.git/clone" did not exist on "11a21a09bcc37da70daf1bfa92cb5ee586257935"
Commit
5d998fb2
authored
Nov 09, 2023
by
charlie
Browse files
progress
parent
3c160a3f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
src/simplify_dyn_ops.cpp
src/simplify_dyn_ops.cpp
+16
-2
No files found.
src/simplify_dyn_ops.cpp
View file @
5d998fb2
...
...
@@ -131,10 +131,24 @@ struct find_const_4in_slice
}
};
/**
* Find allocate into reshape instructions that can be simplified to a static reshape.
* Example:
* x = allocate(constant_dims) -> reshape(input_data, x)
*/
struct
find_static_reshape
{
auto
matcher
const
{
return
match
::
name
(
"allocate"
)(
match
::
nargs
(
1
),
}
};
void
simplify_dyn_ops
::
apply
(
module
&
m
)
const
{
match
::
find_matches
(
m
,
find_static_2in_broadcasts
{},
find_const_3in_slice
{},
find_const_4in_slice
{});
match
::
find_matches
(
m
,
find_static_2in_broadcasts
{},
find_static_alloc_reshape
,
find_const_3in_slice
{},
find_const_4in_slice
{});
match
::
find_matches
(
m
,
find_static_reshape
);
}
}
// namespace MIGRAPHX_INLINE_NS
...
...
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