An execution engine. More...
#include <dnnl.hpp>
Public Types | |
enum | kind { kind::any = dnnl_any_engine, kind::cpu = dnnl_cpu, kind::gpu = dnnl_gpu } |
Kinds of engines. More... | |
Public Member Functions | |
engine (kind akind, size_t index) | |
Constructs an engine. More... | |
engine (kind akind, cl_device_id device, cl_context context) | |
Constructs an engine of particular akind associated with the given OpenCL device and context objects. More... | |
engine (const dnnl_engine_t &aengine) | |
Constructs an engine from other engine aengine . | |
engine (const handle< dnnl_primitive_desc_t > &pd) | |
Constructs an engine from the primitive descriptor pd by querying its engine. More... | |
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. | |
Public Member Functions inherited from dnnl::handle< dnnl_engine_t > | |
handle ()=default | |
Empty constructor. More... | |
handle (dnnl_engine_t t, bool weak=false) | |
Constructs a C handle wrapper from a C handle. More... | |
void | reset (dnnl_engine_t t, bool weak=false) |
Resets the value of a C handle. More... | |
dnnl_engine_t | get (bool allow_emtpy=false) const |
Returns the value of the underlying C handle. | |
Static Public Member Functions | |
static size_t | get_count (kind akind) |
Returns the number of engines of a certain kind. More... | |
An execution engine.
|
strong |
|
inline |
Constructs an engine.
akind | 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 of particular akind
associated with the given OpenCL device
and context
objects.
|
inline |
Constructs an engine from the primitive descriptor pd
by querying its engine.
|
inlinestatic |
Returns the number of engines of a certain kind.
akind | The kind of engines to count. |