| 146 | |
| 147 | template <typename Scalar, typename PackedScalar> |
| 148 | void CreatePackedMatrix(Side side, const KernelLayout& kernel_layout, |
| 149 | TrMulParams* params) { |
| 150 | // Ruy always uses 32-bit signed accumulators for quantized |
| 151 | // matrix multiplication, so we would like to always use std::int32_t |
| 152 | // unconditionally for SumsType. |
| 153 | // However, for floating point types, we still need a reasonable type here to |
| 154 | // avoid tripping assertions elsewhere in the code. |
| 155 | using SumsType = |
| 156 | typename std::conditional<std::is_floating_point<Scalar>::value, Scalar, |
| 157 | std::int32_t>::type; |
| 158 | |
| 159 | const DMatrix& src = params->src[side]; |
| 160 | PMatrix* packed = ¶ms->packed[side]; |
| 161 | packed->data_type = Type::Create<PackedScalar>(); |
| 162 | packed->sums_type = Type::Create<SumsType>(); |
| 163 | CreatePackedLayout(src.layout, packed->data_type, kernel_layout, |
| 164 | &packed->layout); |
| 165 | packed->zero_point = Pack<PackedScalar, Scalar>(src.zero_point); |
| 166 | } |
| 167 | |
| 168 | template <Path ThePath, typename LhsScalar, typename RhsScalar, |
| 169 | typename DstScalar, typename Spec> |
nothing calls this directly
no test coverage detected