.. index:: pair: group; Binary .. _doxid-group__dnnl__api__binary: Binary ====== .. toctree:: :hidden: struct_dnnl_binary.rst Overview ~~~~~~~~ A primitive to perform tensor operations over two tensors. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block // structs struct :ref:`dnnl::binary`; // global functions :ref:`dnnl_status_t` DNNL_API :ref:`dnnl_binary_primitive_desc_create`( :ref:`dnnl_primitive_desc_t`* primitive_desc, :ref:`dnnl_engine_t` engine, :ref:`dnnl_alg_kind_t` alg_kind, :ref:`const_dnnl_memory_desc_t` src0_desc, :ref:`const_dnnl_memory_desc_t` src1_desc, :ref:`const_dnnl_memory_desc_t` dst_desc, :ref:`const_dnnl_primitive_attr_t` attr ); .. _details-group__dnnl__api__binary: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ A primitive to perform tensor operations over two tensors. .. rubric:: See also: :ref:`Binary ` in developer guide Global Functions ---------------- .. index:: pair: function; dnnl_binary_primitive_desc_create .. _doxid-group__dnnl__api__binary_1ga50078dffd48c6ebd6f6671b7656f5cdb: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl_status_t` DNNL_API dnnl_binary_primitive_desc_create( :ref:`dnnl_primitive_desc_t`* primitive_desc, :ref:`dnnl_engine_t` engine, :ref:`dnnl_alg_kind_t` alg_kind, :ref:`const_dnnl_memory_desc_t` src0_desc, :ref:`const_dnnl_memory_desc_t` src1_desc, :ref:`const_dnnl_memory_desc_t` dst_desc, :ref:`const_dnnl_primitive_attr_t` attr ) Creates a primitive descriptor for a binary primitive. .. note:: Memory descriptors ``src1_desc`` and ``dst_desc`` are alloweded to be initialized with :ref:`dnnl_format_tag_any ` or with format_kind set to :ref:`dnnl_format_kind_any `. .. note:: Both memory descriptors must have the same number of dimensions. Element broadcasting is supported for memory descriptor ``src1_desc`` and are applied to ``src1_desc`` dimensions that have size equal to 1. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - primitive_desc - Output primitive descriptor. * - engine - Engine to use. * - alg_kind - Algorithm kind. Valid values are :ref:`dnnl_binary_add `, :ref:`dnnl_binary_mul `, :ref:`dnnl_binary_max `, :ref:`dnnl_binary_min `, :ref:`dnnl_binary_div `, :ref:`dnnl_binary_sub `, :ref:`dnnl_binary_ge `, :ref:`dnnl_binary_gt `, :ref:`dnnl_binary_le `, :ref:`dnnl_binary_lt `, :ref:`dnnl_binary_eq ` and :ref:`dnnl_binary_ne `. * - src0_desc - Source 0 memory descriptor. * - src1_desc - Source 1 memory descriptor. * - dst_desc - Destination memory descriptor. * - attr - Primitive attributes (can be NULL). .. rubric:: Returns: :ref:`dnnl_success ` on success and a status describing the error otherwise.