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
24005e2f
Commit
24005e2f
authored
Nov 24, 2021
by
Shucai Xiao
Browse files
clang format
parent
70320bbd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
src/targets/gpu/lowering.cpp
src/targets/gpu/lowering.cpp
+12
-10
No files found.
src/targets/gpu/lowering.cpp
View file @
24005e2f
...
@@ -567,31 +567,33 @@ struct miopen_apply
...
@@ -567,31 +567,33 @@ struct miopen_apply
{
{
apply_map
.
emplace
(
"lrn"
,
[
=
](
instruction_ref
ins
)
{
apply_map
.
emplace
(
"lrn"
,
[
=
](
instruction_ref
ins
)
{
auto
s
=
ins
->
get_shape
();
auto
s
=
ins
->
get_shape
();
auto
in
=
ins
->
inputs
().
front
();
auto
in
=
ins
->
inputs
().
front
();
auto
output
=
insert_allocation
(
ins
,
s
);
auto
output
=
insert_allocation
(
ins
,
s
);
auto
type
=
s
.
type
();
auto
type
=
s
.
type
();
if
(
type
==
shape
::
half_type
)
if
(
type
==
shape
::
half_type
)
{
{
shape
s32
{
shape
::
float_type
,
s
.
lens
()};
shape
s32
{
shape
::
float_type
,
s
.
lens
()};
auto
cout32
=
insert_allocation
(
ins
,
s32
);
auto
cout32
=
insert_allocation
(
ins
,
s32
);
auto
cop32
=
make_op
(
"convert"
,
{{
"target_type"
,
shape
::
float_type
}});
auto
cop32
=
make_op
(
"convert"
,
{{
"target_type"
,
shape
::
float_type
}});
auto
convert32
=
mod
->
insert_instruction
(
ins
,
make_op
(
"gpu::convert"
,
cop32
.
to_value
()),
in
,
cout32
);
auto
convert32
=
mod
->
insert_instruction
(
ins
,
make_op
(
"gpu::convert"
,
cop32
.
to_value
()),
in
,
cout32
);
auto
lout32
=
insert_allocation
(
ins
,
s32
);
auto
lout32
=
insert_allocation
(
ins
,
s32
);
auto
lrn32
=
mod
->
insert_instruction
(
ins
,
make_op
(
"gpu::lrn"
,
ins
->
get_operator
().
to_value
()),
convert32
,
lout32
);
auto
lrn32
=
mod
->
insert_instruction
(
auto
cop16
=
make_op
(
"convert"
,
{{
"target_type"
,
shape
::
half_type
}});
ins
,
make_op
(
"gpu::lrn"
,
ins
->
get_operator
().
to_value
()),
convert32
,
lout32
);
auto
lout16
=
mod
->
insert_instruction
(
ins
,
make_op
(
"gpu::convert"
,
cop16
.
to_value
()),
lrn32
,
output
);
auto
cop16
=
make_op
(
"convert"
,
{{
"target_type"
,
shape
::
half_type
}});
auto
lout16
=
mod
->
insert_instruction
(
ins
,
make_op
(
"gpu::convert"
,
cop16
.
to_value
()),
lrn32
,
output
);
return
mod
->
replace_instruction
(
ins
,
lout16
);
return
mod
->
replace_instruction
(
ins
,
lout16
);
}
}
else
else
{
{
auto
lrn16
=
mod
->
insert_instruction
(
ins
,
make_op
(
"gpu::lrn"
,
ins
->
get_operator
().
to_value
()),
in
,
output
);
auto
lrn16
=
mod
->
insert_instruction
(
ins
,
make_op
(
"gpu::lrn"
,
ins
->
get_operator
().
to_value
()),
in
,
output
);
return
mod
->
replace_instruction
(
ins
,
lrn16
);
return
mod
->
replace_instruction
(
ins
,
lrn16
);
}
}
});
});
}
}
};
};
void
lowering
::
apply
(
module
&
m
)
const
{
miopen_apply
{
&
m
,
this
}.
apply
();
}
void
lowering
::
apply
(
module
&
m
)
const
{
miopen_apply
{
&
m
,
this
}.
apply
();
}
...
...
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