Benoit Jacob | a0ba3ac | 2019-04-08 12:00:37 -0400 | [diff] [blame^] | 1 | // This is the only Ruy header that users should #include. |
| 2 | |
| 3 | #ifndef TENSORFLOW_LITE_EXPERIMENTAL_RUY_RUY_H_ |
| 4 | #define TENSORFLOW_LITE_EXPERIMENTAL_RUY_RUY_H_ |
| 5 | |
| 6 | #include "context.h" |
| 7 | #include "dispatch.h" |
| 8 | #include "matrix.h" |
| 9 | #include "spec.h" |
| 10 | |
| 11 | namespace ruy { |
| 12 | |
| 13 | // Performs a multiplication of matrices. This is Ruy's only API entry point. |
| 14 | // Should be self-explanatory given the above documentation for each of Matrix, |
| 15 | // Spec and Context. See reference code in reference.h, with the caveat that |
| 16 | // that is reference code for transpose-multiply (TrMul) not just multiply; |
| 17 | // see the translation between the two in transpose_dispatch.h. |
| 18 | template <Path CompiledPaths, typename LhsScalar, typename RhsScalar, |
| 19 | typename DstScalar, typename Spec> |
| 20 | void Mul(const Matrix<LhsScalar>& lhs, const Matrix<RhsScalar>& rhs, |
| 21 | const Spec& spec, Context* context, Matrix<DstScalar>* dst) { |
| 22 | MulDispatch<CompiledPaths, LhsScalar, RhsScalar, DstScalar, Spec> dispatch; |
| 23 | dispatch.Mul(lhs, rhs, spec, context, dst); |
| 24 | } |
| 25 | |
| 26 | } // namespace ruy |
| 27 | |
| 28 | #endif // TENSORFLOW_LITE_EXPERIMENTAL_RUY_RUY_H_ |