"tests/vscode:/vscode.git/clone" did not exist on "886575ee43c3e7060d74e2feb2018111e0998013"
Commit caf97a0c authored by Po-Yen, Chen's avatar Po-Yen, Chen
Browse files

Use macro to shorten code

parent 3a558e59
...@@ -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)
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment