#pragma once #include #include namespace deep_gemm { struct EpilogueIdentity { template __device__ __forceinline__ static uint32_t apply_index_n(const uint32_t &n_idx) { return n_idx; } }; template struct EpilogueHeadSplits: EpilogueIdentity { template __device__ __forceinline__ static uint32_t apply_index_n(const uint32_t &n_idx) { DG_STATIC_ASSERT(kLeft % STORE_BLOCK_N == 0 and kMid % STORE_BLOCK_N == 0 and kRight % STORE_BLOCK_N == 0, "Invalid head splits config"); return n_idx + (n_idx + kRight) / (kLeft + kRight) * kMid; } }; #pragma clang diagnostic pop } // namespace deep_gemm