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
9b3e4576
Commit
9b3e4576
authored
May 26, 2023
by
Paul
Browse files
Format
parent
74f21ca6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
26 deletions
+26
-26
src/targets/gpu/jit/ck_gemm.cpp
src/targets/gpu/jit/ck_gemm.cpp
+26
-26
No files found.
src/targets/gpu/jit/ck_gemm.cpp
View file @
9b3e4576
...
@@ -269,22 +269,22 @@ struct ck_gemm_compiler : compiler<ck_gemm_compiler>
...
@@ -269,22 +269,22 @@ struct ck_gemm_compiler : compiler<ck_gemm_compiler>
bool
can_fold_batch
(
const
std
::
vector
<
shape
>&
inputs
)
const
bool
can_fold_batch
(
const
std
::
vector
<
shape
>&
inputs
)
const
{
{
auto
a_shape
=
inputs
[
0
];
auto
a_shape
=
inputs
[
0
];
auto
b_shape
=
inputs
[
1
];
auto
b_shape
=
inputs
[
1
];
auto
rank
=
a_shape
.
lens
().
size
();
auto
rank
=
a_shape
.
lens
().
size
();
auto
b_strides
=
b_shape
.
strides
();
auto
b_strides
=
b_shape
.
strides
();
return
rank
>=
3
and
b_strides
[
rank
-
3
]
==
0
;
return
rank
>=
3
and
b_strides
[
rank
-
3
]
==
0
;
}
}
ck
::
host
::
device_gemm_multiple_d
::
Problem
create_problem
(
const
std
::
vector
<
shape
>&
inputs
,
const
value
&
v
)
const
ck
::
host
::
device_gemm_multiple_d
::
Problem
create_problem
(
const
std
::
vector
<
shape
>&
inputs
,
const
value
&
v
)
const
{
{
auto
a_shape
=
inputs
[
0
];
auto
a_shape
=
inputs
[
0
];
auto
b_shape
=
inputs
[
1
];
auto
b_shape
=
inputs
[
1
];
auto
c_shape
=
inputs
.
back
();
auto
c_shape
=
inputs
.
back
();
auto
rank
=
a_shape
.
lens
().
size
();
auto
rank
=
a_shape
.
lens
().
size
();
auto
b_strides
=
b_shape
.
strides
();
auto
b_strides
=
b_shape
.
strides
();
auto
batch_count
=
get_batch_count
(
c_shape
);
auto
batch_count
=
get_batch_count
(
c_shape
);
auto
m
=
c_shape
.
lens
()[
rank
-
2
];
auto
m
=
c_shape
.
lens
()[
rank
-
2
];
...
@@ -318,19 +318,19 @@ struct ck_gemm_compiler : compiler<ck_gemm_compiler>
...
@@ -318,19 +318,19 @@ struct ck_gemm_compiler : compiler<ck_gemm_compiler>
}
}
return
ck
::
host
::
device_gemm_multiple_d
::
Problem
{
m
,
return
ck
::
host
::
device_gemm_multiple_d
::
Problem
{
m
,
n
,
n
,
k
,
k
,
transA
,
transA
,
transB
,
transB
,
transE
,
transE
,
ds_layout
,
ds_layout
,
a_type
,
a_type
,
b_type
,
b_type
,
e_type
,
e_type
,
ds_type
,
ds_type
,
ck_passthrough
,
ck_passthrough
,
ck_passthrough
,
ck_passthrough
,
cde_op
};
cde_op
};
}
}
operation
compile_op
(
context
&
/* ctx */
,
const
std
::
vector
<
shape
>&
inputs
,
const
value
&
v
)
const
operation
compile_op
(
context
&
/* ctx */
,
const
std
::
vector
<
shape
>&
inputs
,
const
value
&
v
)
const
...
@@ -339,8 +339,8 @@ struct ck_gemm_compiler : compiler<ck_gemm_compiler>
...
@@ -339,8 +339,8 @@ struct ck_gemm_compiler : compiler<ck_gemm_compiler>
auto
b_shape
=
inputs
[
1
];
auto
b_shape
=
inputs
[
1
];
auto
c_shape
=
inputs
.
back
();
auto
c_shape
=
inputs
.
back
();
auto
tuning_value
=
get_tuning_for
({
a_shape
,
b_shape
,
c_shape
});
auto
tuning_value
=
get_tuning_for
({
a_shape
,
b_shape
,
c_shape
});
auto
batch_count
=
get_batch_count
(
c_shape
);
auto
batch_count
=
get_batch_count
(
c_shape
);
auto
problem
=
create_problem
(
inputs
,
v
);
auto
problem
=
create_problem
(
inputs
,
v
);
const
auto
include_header
=
problem
.
GetIncludeHeader
();
const
auto
include_header
=
problem
.
GetIncludeHeader
();
const
auto
solutions
=
problem
.
GetSolutions
(
"gfx90a"
);
const
auto
solutions
=
problem
.
GetSolutions
(
"gfx90a"
);
...
...
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