struct dnnl::primitive_desc

Overview

A base class for descriptors of all primitives that support iteration over multiple implementations. More…

#include <dnnl.hpp>

struct primitive_desc: public dnnl::primitive_desc_base
{
    // methods

    bool next_impl();
    primitive_desc_base();
    primitive_desc_base();
    primitive_desc_base();
    primitive_desc_base();
};

// direct descendants

struct primitive_desc;
struct primitive_desc;
struct primitive_desc;
struct primitive_desc;
struct primitive_desc;
struct primitive_desc;
struct primitive_desc;
struct primitive_desc;
struct primitive_desc;
struct primitive_desc;
struct primitive_desc;
struct primitive_desc;
struct primitive_desc;
struct primitive_desc;
struct primitive_desc;
struct primitive_desc;
struct primitive_desc;
struct primitive_desc;
struct primitive_desc;
struct primitive_desc;
struct primitive_desc;
struct primitive_desc;
struct primitive_desc;
struct primitive_desc;
struct primitive_desc;
struct primitive_desc;
struct primitive_desc;
struct primitive_desc;
struct rnn_primitive_desc_base;
struct primitive_desc;
struct primitive_desc;
struct primitive_desc;
struct primitive_desc;

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;
    engine get_engine() const;
    const char* impl_info_str() const;
    memory::dim query_s64(query what) const;
    memory::dims get_strides() const;
    memory::dims get_dilations() const;
    memory::dims get_padding_l() const;
    memory::dims get_padding_r() const;
    float get_epsilon() const;

    template <typename T = unsigned>
    T get_flags() const;

    dnnl::algorithm get_algorithm() const;
    float get_alpha() const;
    float get_beta() const;
    int get_axis() const;
    memory::dim get_local_size() const;
    float get_k() const;
    float get_p() const;
    std::vector<float> get_factors() const;
    dnnl::algorithm get_cell_kind() const;
    dnnl::rnn_direction get_direction() const;
    dnnl::algorithm get_activation_kind() const;
    memory::dims get_kernel() const;
    memory::dim get_group_size() const;
    dnnl::prop_kind get_prop_kind() const;
    memory::desc query_md(query what, int idx = 0) const;
    memory::desc src_desc(int idx) const;
    memory::desc dst_desc(int idx) const;
    memory::desc weights_desc(int idx) const;
    memory::desc diff_src_desc(int idx) const;
    memory::desc diff_dst_desc(int idx) const;
    memory::desc diff_weights_desc(int idx) const;
    memory::desc src_desc() const;
    memory::desc dst_desc() const;
    memory::desc weights_desc() const;
    memory::desc diff_src_desc() const;
    memory::desc diff_dst_desc() const;
    memory::desc diff_weights_desc() const;
    memory::desc workspace_desc() const;
    memory::desc scratchpad_desc() const;
    engine scratchpad_engine() const;
    primitive_attr get_primitive_attr() const;
    dnnl::primitive::kind get_kind() const;
    std::vector<uint8_t> get_cache_blob_id() const;

Detailed Documentation

A base class for descriptors of all primitives that support iteration over multiple implementations.

Methods

bool next_impl()

Changes the primitive descriptor to point to the next available implementation.

Returns:

true on success and false if the last available implementation has already been reached. In the latter case, the primitive descriptor itself is kept unchanged.

primitive_desc_base()

Default constructor. Produces an empty object.

primitive_desc_base()

Constructs a primitive descriptor base object from a clone of a C API primitive descriptor after verifying that it is what the caller expects.

Note

The prim_kind should map to a primitive that does not have different values of propagation kind (e.g. dnnl::binary).

Note

Primitive descriptor base constructed this way does not support next_impl() (will throw).

Parameters:

pd

C API primitive descriptor to clone.

prim_kind

Expected primitive kind.

primitive_desc_base()

Constructs a primitive descriptor base object from a clone of a C API primitive descriptor after verifying that it is what the caller expects.

Note

Primitive descriptor base constructed this way does not support next_impl() (will throw).

Parameters:

pd

C API primitive descriptor to clone.

prim_kind

Expected primitive kind.

aprop_kind

Expected propagation kind.

primitive_desc_base()

Constructs a primitive descriptor base object from a clone of a C API primitive descriptor after verifying that it is what the caller expects.

Note

Primitive descriptor base constructed this way does not support next_impl() (will throw).

Parameters:

pd

C API primitive descriptor to clone.

prim_kind

Expected primitive kind.

prop_kind1

Expected propagation kind (option 1).

prop_kind2

Expected propagation kind (option 2). This value is checked if the check with prop_kind1 fails.