.. index:: pair: group; Engine .. _doxid-group__dnnl__api__engine: Engine ====== .. toctree:: :hidden: enum_dnnl_engine_kind_t.rst struct_dnnl_engine.rst struct_dnnl_engine-2.rst Overview ~~~~~~~~ An abstraction of a computational device: a CPU, a specific GPU card in the system, etc. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block // typedefs typedef struct :ref:`dnnl_engine`* :ref:`dnnl_engine_t`; // enums enum :ref:`dnnl_engine_kind_t`; // structs struct :ref:`dnnl_engine`; struct :ref:`dnnl::engine`; // global functions :ref:`dnnl_engine_kind_t` :ref:`dnnl::convert_to_c`(:ref:`engine::kind` akind); size_t DNNL_API :ref:`dnnl_engine_get_count`(:ref:`dnnl_engine_kind_t` kind); :ref:`dnnl_status_t` DNNL_API :ref:`dnnl_engine_create`( :ref:`dnnl_engine_t`* engine, :ref:`dnnl_engine_kind_t` kind, size_t index ); :ref:`dnnl_status_t` DNNL_API :ref:`dnnl_engine_get_kind`( :ref:`dnnl_engine_t` engine, :ref:`dnnl_engine_kind_t`* kind ); :ref:`dnnl_status_t` DNNL_API :ref:`dnnl_engine_destroy`(:ref:`dnnl_engine_t` engine); .. _details-group__dnnl__api__engine: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ An abstraction of a computational device: a CPU, a specific GPU card in the system, etc. Most primitives are created to execute computations on one specific engine. The only exceptions are reorder primitives that transfer data between two different engines. .. rubric:: See also: :ref:`Basic Concepts ` Typedefs -------- .. index:: pair: typedef; dnnl_engine_t .. _doxid-group__dnnl__api__engine_1ga1ce7843660e8203ed6e1af9bfd23e14f: .. ref-code-block:: cpp :class: doxyrest-title-code-block typedef struct :ref:`dnnl_engine`* dnnl_engine_t An engine handle. Global Functions ---------------- .. index:: pair: function; convert_to_c .. _doxid-group__dnnl__api__engine_1gae472e59f404ba6527988b046ef24c743: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl_engine_kind_t` dnnl::convert_to_c(:ref:`engine::kind` akind) Converts engine kind enum value from C++ API to C API type. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - akind - C++ API engine kind enum value. .. rubric:: Returns: Corresponding C API engine kind enum value. .. index:: pair: function; dnnl_engine_get_count .. _doxid-group__dnnl__api__engine_1gadff5935622df99a2f89acb5cbea09ab5: .. ref-code-block:: cpp :class: doxyrest-title-code-block size_t DNNL_API dnnl_engine_get_count(:ref:`dnnl_engine_kind_t` kind) Returns the number of engines of a particular kind. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - kind - Kind of engines to count. .. rubric:: Returns: Count of the engines. .. index:: pair: function; dnnl_engine_create .. _doxid-group__dnnl__api__engine_1gab84f82f3011349cbfe368b61882834fd: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl_status_t` DNNL_API dnnl_engine_create( :ref:`dnnl_engine_t`* engine, :ref:`dnnl_engine_kind_t` kind, size_t index ) Creates an engine. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - engine - Output engine. * - kind - Engine kind. * - index - Engine index that should be between 0 and the count of engines of the requested kind. .. rubric:: Returns: :ref:`dnnl_success ` on success and a status describing the error otherwise. .. index:: pair: function; dnnl_engine_get_kind .. _doxid-group__dnnl__api__engine_1ga8a38bdce17f51616d03310a8e8764c8c: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl_status_t` DNNL_API dnnl_engine_get_kind( :ref:`dnnl_engine_t` engine, :ref:`dnnl_engine_kind_t`* kind ) Returns the kind of an engine. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - engine - Engine to query. * - kind - Output engine kind. .. rubric:: Returns: :ref:`dnnl_success ` on success and a status describing the error otherwise. .. index:: pair: function; dnnl_engine_destroy .. _doxid-group__dnnl__api__engine_1ga8d6976b3792cf1ef64d01545929b4d8f: .. ref-code-block:: cpp :class: doxyrest-title-code-block :ref:`dnnl_status_t` DNNL_API dnnl_engine_destroy(:ref:`dnnl_engine_t` engine) Destroys an engine. .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - engine - Engine to destroy. .. rubric:: Returns: :ref:`dnnl_success ` on success and a status describing the error otherwise.