MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / CreatePackedMatrix

Function CreatePackedMatrix

tensorflow/lite/experimental/ruy/dispatch.h:148–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146
147template <typename Scalar, typename PackedScalar>
148void 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 = &params->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
168template <Path ThePath, typename LhsScalar, typename RhsScalar,
169 typename DstScalar, typename Spec>

Callers

nothing calls this directly

Calls 1

CreatePackedLayoutFunction · 0.85

Tested by

no test coverage detected