diff --git a/library/include/ck/library/reference_tensor_operation/cpu/reference_batched_gemm.hpp b/library/include/ck/library/reference_tensor_operation/cpu/reference_batched_gemm.hpp index ca17255b25..1828387e3c 100644 --- a/library/include/ck/library/reference_tensor_operation/cpu/reference_batched_gemm.hpp +++ b/library/include/ck/library/reference_tensor_operation/cpu/reference_batched_gemm.hpp @@ -105,12 +105,15 @@ struct ReferenceBatchedGemm : public device::BaseOperator { for(int batchIdx = 0;batchIdx < arg.k_batch_;batchIdx++) { - v_c = ck::type_convert(ck::type_convert(v_c) + ck::type_convert(partialSums[batchIdx])); + // mimic the way fp operations would be done on GPU for k-batching + v_c = ck::type_convert(ck::type_convert( + ck::type_convert(v_c) + + ck::type_convert(partialSums[batchIdx]))); } } else { - v_c = partialSums[0]; + v_c = ck::type_convert(partialSums[0]); } arg.c_g_m_n_(g, m, n) = ck::type_convert(v_c);