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
28d577e1
Unverified
Commit
28d577e1
authored
Oct 11, 2023
by
Artur Wojcik
Committed by
GitHub
Oct 10, 2023
Browse files
wrap lambda to support Windows (#2286)
parent
136df3db
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
src/targets/cpu/include/migraphx/cpu/dnnl.hpp
src/targets/cpu/include/migraphx/cpu/dnnl.hpp
+15
-2
No files found.
src/targets/cpu/include/migraphx/cpu/dnnl.hpp
View file @
28d577e1
...
@@ -91,6 +91,19 @@ struct post_op : reflect_equality<post_op>, reflect_stream<post_op>
...
@@ -91,6 +91,19 @@ struct post_op : reflect_equality<post_op>, reflect_stream<post_op>
}
}
};
};
template
<
class
F
>
struct
execute_wrapper
{
F
f
;
argument
operator
()(
context
&
,
const
std
::
vector
<
argument
>&
args
)
const
{
return
f
(
args
);
}
};
template
<
class
F
>
execute_wrapper
<
F
>
make_execute_wrapper
(
F
f
)
{
return
{
std
::
move
(
f
)};
}
template
<
class
Derived
,
class
Primitive
>
template
<
class
Derived
,
class
Primitive
>
struct
dnnl_op
:
auto_register_op
<
Derived
>
struct
dnnl_op
:
auto_register_op
<
Derived
>
{
{
...
@@ -308,7 +321,7 @@ struct dnnl_op : auto_register_op<Derived>
...
@@ -308,7 +321,7 @@ struct dnnl_op : auto_register_op<Derived>
#ifndef NDEBUG
#ifndef NDEBUG
auto
prim_attr
=
get_primitive_attr
(
md
);
auto
prim_attr
=
get_primitive_attr
(
md
);
#endif
#endif
execute
=
[
=
](
context
&
,
const
std
::
vector
<
argument
>&
args
)
{
execute
=
make_execute_wrapper
([
=
](
const
std
::
vector
<
argument
>&
args
)
{
#ifndef NDEBUG
#ifndef NDEBUG
// Check that the memory descriptors have not changed
// Check that the memory descriptors have not changed
auto
debug_args
=
args
;
auto
debug_args
=
args
;
...
@@ -379,7 +392,7 @@ struct dnnl_op : auto_register_op<Derived>
...
@@ -379,7 +392,7 @@ struct dnnl_op : auto_register_op<Derived>
m
[
arg_lookup
[
i
]]
=
to_dnnl_memory
(
md
.
at
(
arg_lookup
[
i
]),
args
[
i
]);
m
[
arg_lookup
[
i
]]
=
to_dnnl_memory
(
md
.
at
(
arg_lookup
[
i
]),
args
[
i
]);
prim
.
execute
(
get_dnnl_context
().
stream
,
m
);
prim
.
execute
(
get_dnnl_context
().
stream
,
m
);
return
args
.
back
();
return
args
.
back
();
};
}
)
;
}
}
std
::
vector
<
shape
>
trim_post_op_inputs
(
const
std
::
vector
<
shape
>&
inputs
)
const
std
::
vector
<
shape
>
trim_post_op_inputs
(
const
std
::
vector
<
shape
>&
inputs
)
const
{
{
...
...
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