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
a86c351b
Commit
a86c351b
authored
Feb 21, 2022
by
Paul
Browse files
Sort parameter names
parent
f4ac55be
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
src/targets/gpu/fuse_mlir.cpp
src/targets/gpu/fuse_mlir.cpp
+4
-1
src/targets/gpu/mlir.cpp
src/targets/gpu/mlir.cpp
+2
-0
No files found.
src/targets/gpu/fuse_mlir.cpp
View file @
a86c351b
...
@@ -48,7 +48,10 @@ struct find_conv_pointwise
...
@@ -48,7 +48,10 @@ struct find_conv_pointwise
});
});
mm
.
add_return
(
mm
.
insert_module_instructions
(
mm
.
end
(),
pm
,
param_map
));
mm
.
add_return
(
mm
.
insert_module_instructions
(
mm
.
end
(),
pm
,
param_map
));
auto
inputs
=
ins
->
inputs
();
std
::
vector
<
instruction_ref
>
inputs
;
std
::
copy_if
(
ins
->
inputs
().
begin
(),
ins
->
inputs
().
end
(),
std
::
back_inserter
(
inputs
),
[
&
](
auto
input
)
{
return
input
!=
conv_ins
;
});
inputs
.
insert
(
inputs
.
end
(),
conv_ins
->
inputs
().
begin
(),
conv_ins
->
inputs
().
end
());
inputs
.
insert
(
inputs
.
end
(),
conv_ins
->
inputs
().
begin
(),
conv_ins
->
inputs
().
end
());
inputs
.
push_back
(
m
.
insert_instruction
(
inputs
.
push_back
(
m
.
insert_instruction
(
ins
,
make_op
(
"hip::allocate"
,
{{
"shape"
,
to_value
(
ins
->
get_shape
())}})));
ins
,
make_op
(
"hip::allocate"
,
{{
"shape"
,
to_value
(
ins
->
get_shape
())}})));
...
...
src/targets/gpu/mlir.cpp
View file @
a86c351b
...
@@ -386,6 +386,7 @@ struct mlir_program
...
@@ -386,6 +386,7 @@ struct mlir_program
insert
(
MlirBlock
body
,
const
module
&
m
,
std
::
unordered_map
<
instruction_ref
,
MlirValue
>&
ins_map
)
insert
(
MlirBlock
body
,
const
module
&
m
,
std
::
unordered_map
<
instruction_ref
,
MlirValue
>&
ins_map
)
{
{
auto
names
=
m
.
get_parameter_names
();
auto
names
=
m
.
get_parameter_names
();
std
::
sort
(
names
.
begin
(),
names
.
end
());
std
::
vector
<
shape
>
inputs
;
std
::
vector
<
shape
>
inputs
;
std
::
transform
(
names
.
begin
(),
std
::
transform
(
names
.
begin
(),
names
.
end
(),
names
.
end
(),
...
@@ -522,6 +523,7 @@ instruction_ref insert_mlir(module& m,
...
@@ -522,6 +523,7 @@ instruction_ref insert_mlir(module& m,
const
module
&
mmlir
,
const
module
&
mmlir
,
const
std
::
vector
<
instruction_ref
>&
inputs
)
const
std
::
vector
<
instruction_ref
>&
inputs
)
{
{
assert
(
mmlir
.
get_parameter_names
().
size
()
==
inputs
.
size
()
-
1
);
auto
co
=
compile_mlir
(
mmlir
);
auto
co
=
compile_mlir
(
mmlir
);
std
::
vector
<
instruction_ref
>
refs
;
std
::
vector
<
instruction_ref
>
refs
;
...
...
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