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
4c42a46d
"vscode:/vscode.git/clone" did not exist on "ba878d29b38ad846299b5344a0363868c2737c4b"
Commit
4c42a46d
authored
Sep 25, 2018
by
Paul
Browse files
Add the program to the matcher callback
parent
b8a7d3bb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
src/include/migraph/matcher.hpp
src/include/migraph/matcher.hpp
+1
-1
test/matcher.cpp
test/matcher.cpp
+2
-2
No files found.
src/include/migraph/matcher.hpp
View file @
4c42a46d
...
...
@@ -217,7 +217,7 @@ void find_matches(program& p, Ms&&... ms)
auto
r
=
match_instruction
(
p
,
ins
,
m
.
matcher
());
if
(
r
.
result
==
p
.
end
())
return
;
m
.
apply
(
r
);
m
.
apply
(
p
,
r
);
match
=
true
;
},
ms
...);
...
...
test/matcher.cpp
View file @
4c42a46d
...
...
@@ -355,7 +355,7 @@ struct match_find_sum
migraph
::
instruction_ref
ins
;
auto
matcher
()
const
{
return
matchers
::
name
(
"sum"
);
}
void
apply
(
matchers
::
matcher_result
r
)
const
{
EXPECT
(
bool
{
r
.
result
==
ins
});
}
void
apply
(
migraph
::
program
&
,
matchers
::
matcher_result
r
)
const
{
EXPECT
(
bool
{
r
.
result
==
ins
});
}
};
struct
match_find_literal
...
...
@@ -363,7 +363,7 @@ struct match_find_literal
migraph
::
instruction_ref
ins
;
auto
matcher
()
const
{
return
matchers
::
name
(
"@literal"
);
}
void
apply
(
matchers
::
matcher_result
r
)
const
void
apply
(
migraph
::
program
&
,
matchers
::
matcher_result
r
)
const
{
EXPECT
(
bool
{
r
.
result
!=
ins
});
EXPECT
(
r
.
result
->
name
()
==
"@literal"
);
...
...
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