Deep Neural Network Library (DNNL)  1.1.3
Performance library for Deep Learning
Public Types | Public Member Functions | Static Public Member Functions | List of all members
dnnl::engine Struct Reference

An execution engine. More...

#include <dnnl.hpp>

Inheritance diagram for dnnl::engine:
Inheritance graph
[legend]
Collaboration diagram for dnnl::engine:
Collaboration graph
[legend]

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...
 

Detailed Description

An execution engine.

Examples:
cnn_inference_f32.cpp, getting_started.cpp, gpu_opencl_interop.cpp, memory_format_propagation.cpp, and performance_profiling.cpp.

Member Enumeration Documentation

◆ kind

enum dnnl::engine::kind
strong

Kinds of engines.

Enumerator
any 

An unspecified engine.

cpu 

CPU engine.

gpu 

GPU engine.

Constructor & Destructor Documentation

◆ engine() [1/3]

dnnl::engine::engine ( kind  akind,
size_t  index 
)
inline

Constructs an engine.

Parameters
akindThe kind of engine to construct.
indexThe index of the engine. Must be less than the value returned by get_count() for this particular kind of engine.

◆ engine() [2/3]

dnnl::engine::engine ( kind  akind,
cl_device_id  device,
cl_context  context 
)
inline

Constructs an engine of particular akind associated with the given OpenCL device and context objects.

◆ engine() [3/3]

dnnl::engine::engine ( const handle< dnnl_primitive_desc_t > &  pd)
inline

Constructs an engine from the primitive descriptor pd by querying its engine.

Member Function Documentation

◆ get_count()

static size_t dnnl::engine::get_count ( kind  akind)
inlinestatic

Returns the number of engines of a certain kind.

Parameters
akindThe kind of engines to count.

The documentation for this struct was generated from the following file: