Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
ecc10f2c
Commit
ecc10f2c
authored
Jul 03, 2019
by
Paul
Browse files
Fix lifetime bug in lambda
parent
9f934033
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
src/include/migraphx/matcher.hpp
src/include/migraphx/matcher.hpp
+4
-2
No files found.
src/include/migraphx/matcher.hpp
View file @
ecc10f2c
...
...
@@ -265,7 +265,7 @@ struct match_fold_f
static
bool
fold_matchers
(
matcher_context
&
ctx
,
instruction_ref
ins
,
Ms
...
ms
)
{
Op
op
;
auto
matched
=
[
&
](
auto
m
)
{
return
[
&
]
{
return
ctx
.
matched
(
m
,
ins
);
};
};
auto
matched
=
[
&
](
auto
m
)
{
return
[
=
,
&
ctx
]
{
return
ctx
.
matched
(
m
,
ins
);
};
};
return
fold
([
&
](
auto
x
,
auto
y
)
{
return
op
(
always
(
x
),
matched
(
y
));
})(
Start
,
ms
...);
}
...
...
@@ -400,7 +400,9 @@ inline auto name(std::unordered_set<std::string> names)
inline
auto
nargs
(
std
::
size_t
n
)
{
return
make_basic_pred_matcher
([
=
](
instruction_ref
ins
)
{
return
ins
->
inputs
().
size
()
==
n
;
});
return
make_basic_pred_matcher
([
=
](
instruction_ref
ins
)
{
return
ins
->
inputs
().
size
()
==
n
;
});
}
inline
auto
arg
(
std
::
size_t
i
)
...
...
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