An execution engine. More...
#include <dnnl.hpp>


Public Types | |
| enum class | kind |
| Kinds of engines. More... | |
Public Member Functions | |
| engine ()=default | |
| Constructs an empty engine. | |
| engine (kind kind, size_t index) | |
| Constructs an engine. | |
| engine (kind kind, cl_device_id device, cl_context context) | |
| Constructs an engine from OpenCL device and context objects. | |
| engine (const handle< dnnl_primitive_desc_t > &pd) | |
Constructs an engine based on a primitive from the primitive descriptor pd by querying its engine. | |
| kind | get_kind () const |
| Returns the kind of the engine. | |
| cl_context | get_ocl_context () const |
| Returns the OpenCL context associated with the engine. | |
| cl_device_id | get_ocl_device () const |
| Returns the OpenCL device associated with the engine. | |
| handle ()=default | |
| Constructs an empty handle object. | |
| handle (const handle< T, traits > &)=default | |
| Copy constructor. | |
| handle (handle< T, traits > &&)=default | |
| Move constructor. | |
| handle (T t, bool weak=false) | |
| Constructs a handle wrapper object from a C API handle. | |
| Public Member Functions inherited from dnnl::handle< dnnl_engine_t > | |
| handle ()=default | |
| Constructs an empty handle object. | |
| handle< dnnl_engine_t, handle_traits< dnnl_engine_t > > & | operator= (const handle< dnnl_engine_t, handle_traits< dnnl_engine_t > > &)=default |
| Assignment operator. | |
| void | reset (dnnl_engine_t t, bool weak=false) |
| Resets the handle wrapper objects to wrap a new C API handle. | |
| dnnl_engine_t | get (bool allow_empty=false) const |
| Returns the underlying C API handle. | |
| operator dnnl_engine_t () const | |
| Converts a handle to the underlying C API handle type. | |
| operator bool () const | |
| Checks whether the object is empty. | |
Static Public Member Functions | |
| static size_t | get_count (kind kind) |
| Returns the number of engines of a certain kind. | |
| template<typename primitive_desc> | |
| static engine | query (const primitive_desc &pd) |
| Returns the engine of a primitive descriptor. | |
An execution engine.
|
strong |
Kinds of engines.
| Enumerator | |
|---|---|
| any | An unspecified engine. |
| cpu | CPU engine. |
| gpu | GPU engine. |
|
default |
Constructs an empty engine.
An empty engine cannot be used in any operations.
|
inline |
Constructs an engine.
| kind | The kind of engine to construct. |
| index | The index of the engine. Must be less than the value returned by get_count() for this particular kind of engine. |
|
inline |
Constructs an engine from OpenCL device and context objects.
| kind | The kind of engine to construct. |
| device | The OpenCL device that this engine will encapsulate. |
| context | The OpenCL context (containing the device) that this engine will use for all operations. |
|
inline |
Constructs an engine based on a primitive from the primitive descriptor pd by querying its engine.
| pd | The primitive descriptor to query. |
|
inlinestatic |
Returns the number of engines of a certain kind.
| kind | The kind of engines to count. |
|
inline |
Returns the kind of the engine.
|
inline |
Returns the OpenCL context associated with the engine.
|
inline |
Returns the OpenCL device associated with the engine.
|
inlinestatic |
Returns the engine of a primitive descriptor.
| pd | The primitive descriptor to query. |
|
default |
Constructs an empty handle object.
|
inlineexplicit |
Constructs a handle wrapper object from a C API handle.
| t | The C API handle to wrap. |
| weak | A flag specifying whether to construct a weak wrapper; defaults to false. |