struct dnnl::engine

Overview

An execution engine. More…

#include <dnnl.hpp>

struct engine: public dnnl::handle
{
    // enums

    enum kind;

    // construction

    engine();
    engine(kind akind, size_t index);
    engine(const handle<dnnl_primitive_desc_t>& pd);

    // methods

    kind get_kind() const;
    handle();
    handle();
    handle();
    handle();
    static size_t get_count(kind akind);

    template <typename primitive_desc>
    static engine query(const primitive_desc& pd);
};

Inherited Members

public:
    // methods

    handle<T, traits>& operator = (const handle<T, traits>&);
    handle<T, traits>& operator = (handle<T, traits>&&);
    void reset(T t, bool weak = false);
    T get(bool allow_empty = false) const;
    operator T () const;
    operator bool () const;
    bool operator == (const handle<T, traits>& other) const;
    bool operator != (const handle& other) const;

Detailed Documentation

An execution engine.

Construction

engine()

Constructs an empty engine.

An empty engine cannot be used in any operations.

engine(kind akind, size_t index)

Constructs an engine.

Parameters:

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.

engine(const handle<dnnl_primitive_desc_t>& pd)

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

Parameters:

pd

The primitive descriptor to query.

Methods

kind get_kind() const

Returns the kind of the engine.

Returns:

The kind of the engine.

handle()

Constructs an empty handle object.

Warning

Uninitialized object cannot be used in most library calls and is equivalent to a null pointer. Any attempt to use its methods, or passing it to the other library function, will cause an exception to be thrown.

handle()

Copy constructor.

handle()

Move constructor.

handle()

Constructs a handle wrapper object from a C API handle.

Parameters:

t

The C API handle to wrap.

weak

A flag specifying whether to construct a weak wrapper; defaults to false.

static size_t get_count(kind akind)

Returns the number of engines of a certain kind.

Parameters:

akind

The kind of engines to count.

Returns:

The number of engines of the specified kind.

template <typename primitive_desc>
static engine query(const primitive_desc& pd)

Returns the engine of a primitive descriptor.

Parameters:

pd

The primitive descriptor to query.

Returns:

A weak handle to the engine that the primitive descriptor was created with.