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
c393f233
Commit
c393f233
authored
Sep 21, 2023
by
Alan Turner
Browse files
Formatting
parent
37939805
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
src/targets/gpu/fuse_ck.cpp
src/targets/gpu/fuse_ck.cpp
+12
-10
No files found.
src/targets/gpu/fuse_ck.cpp
View file @
c393f233
...
@@ -243,19 +243,21 @@ struct find_ck_gemm_softmax_gemm
...
@@ -243,19 +243,21 @@ struct find_ck_gemm_softmax_gemm
auto
gemm1_ins
=
r
.
instructions
[
"gemm1"
];
auto
gemm1_ins
=
r
.
instructions
[
"gemm1"
];
auto
scale_ins
=
r
.
instructions
[
"scale"
];
auto
scale_ins
=
r
.
instructions
[
"scale"
];
if
(
scale_ins
->
module_inputs
().
size
()
!=
1
or
not
is_mul_module
(
*
scale_ins
->
module_inputs
().
front
()))
if
(
scale_ins
->
module_inputs
().
size
()
!=
1
or
not
is_mul_module
(
*
scale_ins
->
module_inputs
().
front
()))
return
;
return
;
if
(
not
ck_gemm_softmax_gemm
::
is_ck_supported_type
(
gemm1_ins
->
get_shape
().
type
()))
if
(
not
ck_gemm_softmax_gemm
::
is_ck_supported_type
(
gemm1_ins
->
get_shape
().
type
()))
return
;
return
;
double
scale
=
1.0
;
double
scale
=
1.0
;
for
(
auto
&
in
:
scale_ins
->
inputs
())
for
(
auto
&
in
:
scale_ins
->
inputs
())
{
{
if
(
in
->
can_eval
())
if
(
in
->
can_eval
())
{
{
in
->
get_literal
().
visit
([
&
](
const
auto
s
)
{
in
->
get_literal
().
visit
([
&
](
const
auto
s
)
{
if
(
std
::
all_of
(
if
(
std
::
all_of
(
s
.
begin
()
+
1
,
s
.
end
(),
[
&
](
auto
v
)
{
s
.
begin
()
+
1
,
s
.
end
(),
[
&
](
auto
v
)
{
return
float_equal
(
v
,
s
.
front
());
}))
return
float_equal
(
v
,
s
.
front
());
}))
scale
=
s
.
front
();
scale
=
s
.
front
();
else
else
return
;
return
;
...
...
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