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

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.