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
b581c8b1
Commit
b581c8b1
authored
Jan 05, 2023
by
jungpark-mlir
Browse files
Update mlir.cpp
parent
75bfeada
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
src/targets/gpu/mlir.cpp
src/targets/gpu/mlir.cpp
+9
-6
No files found.
src/targets/gpu/mlir.cpp
View file @
b581c8b1
...
@@ -541,12 +541,16 @@ struct mlir_program
...
@@ -541,12 +541,16 @@ struct mlir_program
code_object_op
compile
()
MIGRAPHX_TIDY_CONST
code_object_op
compile
()
MIGRAPHX_TIDY_CONST
{
{
mlir_pass_manager
pm
{
mlirPassManagerCreate
(
ctx
.
get
())};
mlir_pass_manager
pm_front
{
mlirPassManagerCreate
(
ctx
.
get
())};
mlir_pass_manager
pm_back
{
mlirPassManagerCreate
(
ctx
.
get
())};
// 1st pipeline to call
// 1st pipeline to call
mlirMIGraphXAddHighLevelPipeline
(
pm
.
get
());
mlirMIGraphXAddHighLevelPipeline
(
pm_front
.
get
());
mlirPassManagerRun
(
pm_front
.
get
(),
mmodule
.
get
());
// 2nd pipeline to call
// 2nd pipeline to call
mlirMIGraphXAddBackendPipeline
(
pm
.
get
(),
target_arch
.
c_str
());
get_module_tuned
();
mlirPassManagerRun
(
pm
.
get
(),
mmodule
.
get
());
mlirMIGraphXAddBackendPipeline
(
pm_back
.
get
(),
target_arch
.
c_str
());
mlirPassManagerRun
(
pm_back
.
get
(),
mmodule
.
get
());
code_object_op
op
{};
code_object_op
op
{};
op
.
symbol_name
=
"mlir_main"
;
op
.
symbol_name
=
"mlir_main"
;
...
@@ -599,7 +603,7 @@ struct mlir_program
...
@@ -599,7 +603,7 @@ struct mlir_program
{
{
if
(
!
mlirRockTuningSetFromTable
(
tuning_table
,
mmodule
.
get
()))
if
(
!
mlirRockTuningSetFromTable
(
tuning_table
,
mmodule
.
get
()))
{
{
printf
(
"fails to set param on %s
\n
"
,
mlirRockTuningGetKey
(
tuning_table
,
module
));
printf
(
"fails to set param on
<
%s
>
\n
"
,
mlirRockTuningGetKey
(
tuning_table
,
m
module
.
get
()
));
return
false
;
return
false
;
}
}
return
true
;
return
true
;
...
@@ -681,7 +685,6 @@ code_object_op compile_mlir(const context&, module m, const std::vector<instruct
...
@@ -681,7 +685,6 @@ code_object_op compile_mlir(const context&, module m, const std::vector<instruct
mp
.
find_target
();
mp
.
find_target
();
mp
.
parse
(
m
);
mp
.
parse
(
m
);
mp
.
tuning_table_create
();
mp
.
tuning_table_create
();
mp
.
get_module_tuned
();
auto
mod_op
=
mlirModuleGetOperation
(
mp
.
mmodule
.
get
());
auto
mod_op
=
mlirModuleGetOperation
(
mp
.
mmodule
.
get
());
if
(
trace
)
if
(
trace
)
std
::
cout
<<
mlir_print
(
&
mlirOperationPrint
,
mod_op
)
<<
std
::
endl
;
std
::
cout
<<
mlir_print
(
&
mlirOperationPrint
,
mod_op
)
<<
std
::
endl
;
...
...
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