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
e2967e04
Commit
e2967e04
authored
Dec 10, 2021
by
Paul
Browse files
Format
parent
df3749cd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
src/targets/gpu/include/migraphx/gpu/mlir.hpp
src/targets/gpu/include/migraphx/gpu/mlir.hpp
+4
-1
src/targets/gpu/mlir.cpp
src/targets/gpu/mlir.cpp
+7
-4
No files found.
src/targets/gpu/include/migraphx/gpu/mlir.hpp
100755 → 100644
View file @
e2967e04
...
@@ -14,7 +14,10 @@ namespace gpu {
...
@@ -14,7 +14,10 @@ namespace gpu {
std
::
string
dump_mlir
(
const
module
&
m
);
std
::
string
dump_mlir
(
const
module
&
m
);
code_object_op
compile_mlir
(
const
module
&
m
);
code_object_op
compile_mlir
(
const
module
&
m
);
instruction_ref
insert_mlir
(
module
&
m
,
instruction_ref
ins
,
const
module
&
mmlir
,
const
std
::
vector
<
instruction_ref
>&
inputs
);
instruction_ref
insert_mlir
(
module
&
m
,
instruction_ref
ins
,
const
module
&
mmlir
,
const
std
::
vector
<
instruction_ref
>&
inputs
);
}
// namespace gpu
}
// namespace gpu
}
// namespace MIGRAPHX_INLINE_NS
}
// namespace MIGRAPHX_INLINE_NS
...
...
src/targets/gpu/mlir.cpp
View file @
e2967e04
...
@@ -510,7 +510,10 @@ code_object_op compile_mlir(const module& m)
...
@@ -510,7 +510,10 @@ code_object_op compile_mlir(const module& m)
return
mp
.
compile
();
return
mp
.
compile
();
}
}
instruction_ref
insert_mlir
(
module
&
m
,
instruction_ref
ins
,
const
module
&
mmlir
,
const
std
::
vector
<
instruction_ref
>&
inputs
)
instruction_ref
insert_mlir
(
module
&
m
,
instruction_ref
ins
,
const
module
&
mmlir
,
const
std
::
vector
<
instruction_ref
>&
inputs
)
{
{
auto
co
=
compile_mlir
(
mmlir
);
auto
co
=
compile_mlir
(
mmlir
);
...
@@ -527,10 +530,10 @@ instruction_ref insert_mlir(module& m, instruction_ref ins, const module& mmlir,
...
@@ -527,10 +530,10 @@ instruction_ref insert_mlir(module& m, instruction_ref ins, const module& mmlir,
return
lit
;
return
lit
;
};
};
for
(
auto
input
:
inputs
)
for
(
auto
input
:
inputs
)
{
{
const
size_t
offset
=
0
;
const
size_t
offset
=
0
;
auto
s
=
input
->
get_shape
();
auto
s
=
input
->
get_shape
();
refs
.
push_back
(
input
);
refs
.
push_back
(
input
);
refs
.
push_back
(
input
);
refs
.
push_back
(
input
);
refs
.
push_back
(
get_literal
(
offset
));
// offset
refs
.
push_back
(
get_literal
(
offset
));
// offset
...
@@ -550,7 +553,7 @@ instruction_ref insert_mlir(module& m, instruction_ref ins, const module& mmlir,
...
@@ -550,7 +553,7 @@ instruction_ref insert_mlir(module& m, instruction_ref ins, const module& mmlir,
refs
.
push_back
(
get_literal
(
1
));
// G
refs
.
push_back
(
get_literal
(
1
));
// G
}
}
co
.
expected_inputs
=
to_shapes
(
refs
);
co
.
expected_inputs
=
to_shapes
(
refs
);
co
.
output
=
mmlir
.
get_output_shapes
().
front
();
co
.
output
=
mmlir
.
get_output_shapes
().
front
();
return
m
.
insert_instruction
(
ins
,
co
,
refs
);
return
m
.
insert_instruction
(
ins
,
co
,
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