Fix segfault in profiler when B is pk_i4_t

b_device_buf's size in bytes is larger than b_k_n_permute so b_device_buf.ToDevice reads out-of-bounds.
This commit is contained in:
Anton Gorenko
2025-05-21 13:33:04 +05:00
parent c7d39a075e
commit 8b5d340d09

View File

@@ -105,9 +105,9 @@ bool profile_gemm_universal_impl(int do_verification,
const auto b_element_op = BElementOp{};
const auto c_element_op = CElementOp{};
DeviceMem a_device_buf(sizeof(ADataType) * a_m_k.mDesc.GetElementSpaceSize());
DeviceMem b_device_buf(sizeof(BDataType) * b_k_n_permute.mDesc.GetElementSpaceSize());
DeviceMem c_device_buf(sizeof(CDataType) * c_m_n_device_result.mDesc.GetElementSpaceSize());
DeviceMem a_device_buf(a_m_k.GetElementSpaceSizeInBytes());
DeviceMem b_device_buf(b_k_n_permute.GetElementSpaceSizeInBytes());
DeviceMem c_device_buf(c_m_n_device_result.GetElementSpaceSizeInBytes());
a_device_buf.ToDevice(a_m_k.mData.data());