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
789afa39
"example/1_gemm_xdl/gemm_xdl_bf16.cpp" did not exist on "64350affc5767e7ce3fb211d8145b5c9d18017d8"
Commit
789afa39
authored
Apr 19, 2019
by
Shucai Xiao
Browse files
fix cppcheck errors
parent
5a0c8ca7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
21 deletions
+24
-21
src/quantization.cpp
src/quantization.cpp
+23
-20
src/targets/gpu/include/migraphx/gpu/convert.hpp
src/targets/gpu/include/migraphx/gpu/convert.hpp
+1
-1
No files found.
src/quantization.cpp
View file @
789afa39
...
...
@@ -88,32 +88,35 @@ void quantize(program& prog, const std::vector<std::string>& ins_names)
}
}
if
(
inputs
!=
converted_inputs
)
// no change for the input, return directly
if
(
inputs
==
converted_inputs
)
{
auto
op
=
ins
->
get_operator
();
auto
ins_shape
=
compute_shape
(
op
,
converted_inputs
);
if
(
ins_shape
.
type
()
!=
orig_type
)
return
;
}
auto
op
=
ins
->
get_operator
();
auto
ins_shape
=
compute_shape
(
op
,
converted_inputs
);
if
(
ins_shape
.
type
()
!=
orig_type
)
{
// insert another convert instruction to convert it back
if
(
ins
==
std
::
prev
(
prog
.
end
()))
{
// insert another convert instruction to convert it back
if
(
ins
==
std
::
prev
(
prog
.
end
()))
{
prog
.
add_instruction
(
op
::
convert
{
orig_type
},
ins
);
}
else
prog
.
add_instruction
(
op
::
convert
{
orig_type
},
ins
);
}
else
{
// check the dead code case to avoid assert
bool
output_empty
=
ins
->
outputs
().
empty
();
auto
ins_orig_type
=
prog
.
insert_instruction
(
std
::
next
(
ins
),
op
::
convert
{
orig_type
},
ins
);
if
(
!
output_empty
)
{
// check the dead code case to avoid assert
bool
output_empty
=
ins
->
outputs
().
empty
();
auto
ins_orig_type
=
prog
.
insert_instruction
(
std
::
next
(
ins
),
op
::
convert
{
orig_type
},
ins
);
if
(
!
output_empty
)
{
prog
.
replace_instruction
(
ins
,
ins_orig_type
);
}
prog
.
replace_instruction
(
ins
,
ins_orig_type
);
}
}
prog
.
replace_instruction
(
ins
,
op
,
converted_inputs
);
}
prog
.
replace_instruction
(
ins
,
op
,
converted_inputs
);
}
}
...
...
src/targets/gpu/include/migraphx/gpu/convert.hpp
View file @
789afa39
...
...
@@ -17,7 +17,7 @@ struct hip_convert : unary_device<hip_convert, device::convert>
op
::
convert
op
;
hip_convert
(
const
op
::
convert
&
oper
)
:
op
(
oper
)
{}
hip_convert
(
const
op
::
convert
&&
oper
)
:
op
(
std
::
move
(
oper
)
)
{}
hip_convert
(
const
op
::
convert
&&
oper
)
:
op
(
oper
)
{}
shape
compute_shape
(
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