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
4f9088ad
Commit
4f9088ad
authored
Oct 07, 2023
by
Artur Wojcik
Browse files
dnnl: fix DEBUG compilation
parent
c00c696a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
10 deletions
+16
-10
src/targets/cpu/include/migraphx/cpu/dnnl.hpp
src/targets/cpu/include/migraphx/cpu/dnnl.hpp
+16
-10
No files found.
src/targets/cpu/include/migraphx/cpu/dnnl.hpp
View file @
4f9088ad
...
...
@@ -103,20 +103,26 @@ struct dnnl_op : auto_register_op<Derived>
Primitive
prim
;
std
::
vector
<
int
>
arg_lookup
;
#ifdef _DEBUG
const
Derived
&
self
;
const
dnnl_op
&
self
;
const
Derived
&
derived
;
std
::
string
name
;
dnnl
::
primitive_attr
prim_attr
;
const
std
::
vector
<
shape
>&
inputs
;
const
shape
&
output_shape
;
#endif
public:
// clang-format off
executable
(
const
dnnl_op
&
op
,
const
shape
&
output_shape
,
const
std
::
vector
<
shape
>&
inputs
)
:
md
{
op
.
to_memory_desc
(
output_shape
,
inputs
)},
executable
(
const
dnnl_op
&
op
,
const
shape
&
_
output_shape
,
const
std
::
vector
<
shape
>&
_
inputs
)
:
md
{
op
.
to_memory_desc
(
_
output_shape
,
_
inputs
)},
prim
{
op
.
get_primitive
(
md
)},
arg_lookup
{
op
.
create_arg_map
(
inputs
.
size
())}
arg_lookup
{
op
.
create_arg_map
(
_
inputs
.
size
())}
#ifdef _DEBUG
,
self
{
static_cast
<
const
Derived
&>
(
op
)},
,
self
{
op
},
derived
{
static_cast
<
const
Derived
&>
(
op
)},
name
{
derived
.
name
()},
prim_attr
{
outer
.
get_primitive_attr
(
md
)}
prim_attr
{
op
.
get_primitive_attr
(
md
)},
inputs
{
_inputs
},
output_shape
{
_output_shape
}
#endif
// clang-format on
{
...
...
@@ -128,7 +134,7 @@ struct dnnl_op : auto_register_op<Derived>
// Check that the memory descriptors have not changed
auto
debug_args
=
args
;
debug_args
.
pop_back
();
auto
debug_md
=
to_memory_desc
(
output_shape
,
to_shapes
(
debug_args
));
auto
debug_md
=
self
.
to_memory_desc
(
output_shape
,
to_shapes
(
debug_args
));
for
(
auto
&&
p
:
debug_md
)
{
if
(
md
.
count
(
p
.
first
)
==
0
)
...
...
@@ -141,7 +147,7 @@ struct dnnl_op : auto_register_op<Derived>
}
// Check post_ops args are correct
auto
pos
=
prim_attr
.
get_post_ops
();
auto
prim_input_size
=
inputs
.
size
()
-
this
->
get_extra_post_op_args
();
auto
prim_input_size
=
inputs
.
size
()
-
self
.
get_extra_post_op_args
();
int
j
=
0
;
for
(
int
i
=
0
;
i
<
pos
.
len
();
i
++
)
{
...
...
@@ -177,9 +183,9 @@ struct dnnl_op : auto_register_op<Derived>
{
MIGRAPHX_THROW
(
"Unknown kind"
);
}
if
(
to_dnnl_algo
(
post_ops
[
i
].
algo
)
!=
algo
)
if
(
to_dnnl_algo
(
self
.
post_ops
[
i
].
algo
)
!=
algo
)
MIGRAPHX_THROW
(
mesg
+
"Algorithm doesn't match for post op "
+
post_ops
[
i
].
algo
+
" != "
+
to_string
(
algo
));
self
.
post_ops
[
i
].
algo
+
" != "
+
to_string
(
algo
));
}
catch
(
const
dnnl
::
error
&
e
)
{
...
...
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