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
c40a39c3
Commit
c40a39c3
authored
Nov 26, 2023
by
Umang Yadav
Browse files
fix cppcheck
parent
9a9e9648
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
src/eliminate_fp8.cpp
src/eliminate_fp8.cpp
+13
-7
No files found.
src/eliminate_fp8.cpp
View file @
c40a39c3
...
...
@@ -21,6 +21,8 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include "migraphx/serialize.hpp"
#include <iterator>
#include <utility>
#include <migraphx/eliminate_fp8.hpp>
#include <migraphx/make_op.hpp>
...
...
@@ -43,13 +45,17 @@ void eliminate_fp8::apply(module& m) const
migraphx
::
shape
::
type_t
orig_type
=
ins
->
get_shape
().
type
();
std
::
vector
<
instruction_ref
>
orig_inputs
=
ins
->
inputs
();
std
::
vector
<
instruction_ref
>
new_inputs
;
for
(
const
auto
&
i
:
orig_inputs
)
{
new_inputs
.
push_back
(
m
.
insert_instruction
(
ins
,
migraphx
::
make_op
(
"convert"
,
{{
"target_type"
,
migraphx
::
to_value
(
target_type
)}}),
i
));
}
std
::
transform
(
orig_inputs
.
begin
(),
orig_inputs
.
end
(),
std
::
back_inserter
(
new_inputs
),
[
&
](
const
auto
&
i
)
{
return
m
.
insert_instruction
(
ins
,
migraphx
::
make_op
(
"convert"
,
{{
"target_type"
,
migraphx
::
to_value
(
target_type
)}}),
i
);
});
auto
new_ins
=
m
.
insert_instruction
(
ins
,
ins
->
get_operator
(),
{
new_inputs
});
auto
convert_back_ins
=
m
.
insert_instruction
(
ins
,
...
...
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