Commit 5581dc00 authored by Po-Yen, Chen's avatar Po-Yen, Chen
Browse files

Reuse the existing implementation

parent b250bbb8
......@@ -125,14 +125,17 @@ struct BlockToCTileMap_M00_N0_M01Adapt
{
}
__host__ constexpr index_t CalculateGridSize(const CGridDesc_M_N& c_grid_desc_m_n) const
__host__ static constexpr index_t CalculateGridSize(index_t M, index_t N)
{
const auto M0 = math::integer_divide_ceil(c_grid_desc_m_n.GetLength(I0), MPerBlock);
const auto N0 = math::integer_divide_ceil(c_grid_desc_m_n.GetLength(I1), NPerBlock);
const auto M0 = math::integer_divide_ceil(M, MPerBlock);
const auto N0 = math::integer_divide_ceil(N, NPerBlock);
const index_t grid_size = M0 * N0;
return M0 * N0;
}
return grid_size;
__host__ constexpr index_t CalculateGridSize(const CGridDesc_M_N& c_grid_desc_m_n) const
{
return CalculateGridSize(c_grid_desc_m_n.GetLength(I0), c_grid_desc_m_n.GetLength(I1));
}
template <typename TopIdx>
......
......@@ -144,8 +144,7 @@ struct GridwiseGemm_k0mk1_k0nk1_mn_xdl_cshuffle_v1
__host__ __device__ static auto CalculateGridSize(index_t M, index_t N)
{
// reference the implementation of class 'BlockToCTileMap_M00_N0_M01Adapt'
return std::make_tuple(
INTEGER_DIVIDE_CEIL(M, MPerBlock) * INTEGER_DIVIDE_CEIL(N, NPerBlock), 1, 1);
return std::make_tuple(DefaultBlock2CTileMap::CalculateGridSize(M, N), 1, 1);
}
__host__ __device__ static auto CalculateMPadded(index_t M)
......
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