| 74 | template <Path CompiledPaths, typename LhsScalar, typename RhsScalar, |
| 75 | typename DstScalar, typename Spec> |
| 76 | void 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, ¶ms); |
| 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(¶ms, context); |
| 104 | } |
| 105 | |
| 106 | } // namespace ruy |
| 107 | |