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
composable_kernel
Commits
caf97a0c
Commit
caf97a0c
authored
May 04, 2023
by
Po-Yen, Chen
Browse files
Use macro to shorten code
parent
3a558e59
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
include/ck/tensor_operation/gpu/grid/gridwise_gemm_xdl_cshuffle_v1.hpp
...nsor_operation/gpu/grid/gridwise_gemm_xdl_cshuffle_v1.hpp
+9
-3
No files found.
include/ck/tensor_operation/gpu/grid/gridwise_gemm_xdl_cshuffle_v1.hpp
View file @
caf97a0c
...
@@ -136,20 +136,26 @@ struct GridwiseGemm_k0mk1_k0nk1_mn_xdl_cshuffle_v1
...
@@ -136,20 +136,26 @@ struct GridwiseGemm_k0mk1_k0nk1_mn_xdl_cshuffle_v1
using
ThisThreadBlock
=
ThisThreadBlock
<
BlockSize
>
;
using
ThisThreadBlock
=
ThisThreadBlock
<
BlockSize
>
;
#if defined(INTEGER_DIVIDE_CEIL)
#error "macro INTEGER_DIVIDE_CEIL() was already defined somewhere else"
#endif
#define INTEGER_DIVIDE_CEIL(x, y) (((x) + (y)-1) / (y))
__host__
__device__
static
auto
CalculateMPadded
(
index_t
M
)
__host__
__device__
static
auto
CalculateMPadded
(
index_t
M
)
{
{
return
(
M
+
MPerBlock
-
1
)
/
MPerBlock
*
MPerBlock
;
return
INTEGER_DIVIDE_CEIL
(
M
,
MPerBlock
)
*
MPerBlock
;
}
}
__host__
__device__
static
auto
CalculateNPadded
(
index_t
N
)
__host__
__device__
static
auto
CalculateNPadded
(
index_t
N
)
{
{
return
(
N
+
NPerBlock
-
1
)
/
NPerBlock
*
NPerBlock
;
return
INTEGER_DIVIDE_CEIL
(
N
,
NPerBlock
)
*
NPerBlock
;
}
}
__host__
__device__
static
auto
CalculateKPadded
(
index_t
K
)
__host__
__device__
static
auto
CalculateKPadded
(
index_t
K
)
{
{
return
(
K
+
KPerBlock
-
1
)
/
KPerBlock
*
KPerBlock
;
return
INTEGER_DIVIDE_CEIL
(
K
,
KPerBlock
)
*
KPerBlock
;
}
}
#undef INTEGER_DIVIDE_CEIL
__host__
__device__
static
auto
CalculateAK0
(
index_t
K
)
__host__
__device__
static
auto
CalculateAK0
(
index_t
K
)
{
{
...
...
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