.. index:: pair: group; Matrix Multiplication .. _doxid-group__dnnl__api__matmul: Matrix Multiplication ===================== .. toctree:: :hidden: struct_dnnl_matmul_desc_t.rst struct_dnnl_matmul.rst Overview ~~~~~~~~ A primitive to perform matrix-matrix multiplication. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block // structs struct :ref:`dnnl_matmul_desc_t`; struct :ref:`dnnl::matmul`; // global functions :ref:`dnnl_status_t` DNNL_API :ref:`dnnl_matmul_desc_init`( :ref:`dnnl_matmul_desc_t`* matmul_desc, const :ref:`dnnl_memory_desc_t`* src_desc, const :ref:`dnnl_memory_desc_t`* weights_desc, const :ref:`dnnl_memory_desc_t`* bias_desc, const :ref:`dnnl_memory_desc_t`* dst_desc ); .. _details-group__dnnl__api__matmul: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ A primitive to perform matrix-matrix multiplication. The batched mode is supported with 3D tensors. .. rubric:: See also: :ref:`Matrix Multiplication ` in developer guide Global Functions ---------------- .. index:: pair: function; dnnl_matmul_desc_init .. _doxid-group__dnnl__api__matmul_1ga5eb0d52c67c41c51e237172521c2f525: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl_status_t` DNNL_API dnnl_matmul_desc_init( :ref:`dnnl_matmul_desc_t`* matmul_desc, const :ref:`dnnl_memory_desc_t`* src_desc, const :ref:`dnnl_memory_desc_t`* weights_desc, const :ref:`dnnl_memory_desc_t`* bias_desc, const :ref:`dnnl_memory_desc_t`* dst_desc ) Initializes a matrix multiplication descriptor. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - matmul_desc - Output descriptor for matmul primitive. * - src_desc - Source memory descriptor (matrix A) * - weights_desc - Weights memory descriptor (matrix B) * - bias_desc - Bias memory descriptor. Passing NULL, a zero memory descriptor, or a memory descriptor with format_kind set to :ref:`dnnl_format_kind_undef ` disables the bias term. * - dst_desc - Destination memory descriptor (matrix C). .. rubric:: Returns: :ref:`dnnl_success ` on success and a status describing the error otherwise.