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

Function MulWithPrepackedInternal

tensorflow/lite/experimental/ruy/prepack.h:76–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74template <Path CompiledPaths, typename LhsScalar, typename RhsScalar,
75 typename DstScalar, typename Spec>
76void MulWithPrepackedInternal(const Matrix<LhsScalar>& lhs,
77 const Matrix<RhsScalar>& rhs, const Spec& spec,
78 Context* context, Matrix<DstScalar>* dst,
79 SidePair<PrepackedMatrix*> prepacked) {
80 gemmlowp::ScopedProfilingLabel label("MulWithPrepacked");
81
82 EnforceLayoutSupport<Spec>(lhs.layout, rhs.layout, dst->layout);
83 EnforceZeroPointSupport<Spec>(lhs.zero_point, rhs.zero_point,
84 dst->zero_point);
85
86 Path the_path = context->GetPathToTake<CompiledPaths>();
87 RUY_CHECK(the_path != Path::kReference);
88 constexpr Path TrMulCompiledPaths = CompiledPaths & ~Path::kReference;
89 Matrix<LhsScalar> transposed_lhs(lhs);
90 Transpose(&transposed_lhs);
91 TrMulParams params;
92 CreateTrMulParams<TrMulCompiledPaths>(transposed_lhs, rhs, spec, context, dst,
93 the_path, &params);
94
95 for (Side side : {Side::kLhs, Side::kRhs}) {
96 if (prepacked[side]) {
97 params.packed[side].data = prepacked[side]->data;
98 params.packed[side].sums = prepacked[side]->sums;
99 params.is_prepacked[side] = true;
100 }
101 }
102
103 TrMul(&params, context);
104}
105
106} // namespace ruy
107

Callers

nothing calls this directly

Calls 2

TrMulFunction · 0.85
TransposeFunction · 0.70

Tested by

no test coverage detected