struct dnnl::reorder::primitive_desc

Overview

Primitive descriptor for a reorder primitive. More…

#include <dnnl.hpp>

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

    primitive_desc();

    primitive_desc(
        const engine& src_engine,
        const memory::desc& src_md,
        const engine& dst_engine,
        const memory::desc& dst_md,
        const primitive_attr& attr = primitive_attr(),
        bool allow_empty = false
        );

    primitive_desc(
        const memory& src,
        const memory& dst,
        const primitive_attr& attr = primitive_attr(),
        bool allow_empty = false
        );

    primitive_desc(dnnl_primitive_desc_t pd);
    engine get_src_engine() const;
    engine get_dst_engine() const;
    memory::desc src_desc() const;
    memory::desc dst_desc() const;
};

Inherited Members

public:
    // methods

    handle();
    handle(const handle<T, traits>&);
    handle<T, traits>& operator = (const handle<T, traits>&);
    handle(handle<T, traits>&&);
    handle<T, traits>& operator = (handle<T, traits>&&);
    handle(T t, bool weak = false);
    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;
    primitive_desc_base();
    engine get_engine() const;
    const char* impl_info_str() const;
    memory::dim query_s64(query what) 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

Primitive descriptor for a reorder primitive.

Methods

primitive_desc()

Default constructor. Produces an empty object.

primitive_desc(
    const engine& src_engine,
    const memory::desc& src_md,
    const engine& dst_engine,
    const memory::desc& dst_md,
    const primitive_attr& attr = primitive_attr(),
    bool allow_empty = false
    )

Constructs a primitive descriptor for reorder primitive.

Note

If allow_empty is true, the constructor does not throw if a primitive descriptor cannot be created.

Parameters:

src_engine

Engine on which the source memory object will be located.

src_md

Source memory descriptor.

dst_engine

Engine on which the destination memory object will be located.

dst_md

Destination memory descriptor.

attr

Primitive attributes to use (optional).

allow_empty

A flag signifying whether construction is allowed to fail without throwing an exception. In this case an empty object will be produced. This flag is optional and defaults to false.

primitive_desc(
    const memory& src,
    const memory& dst,
    const primitive_attr& attr = primitive_attr(),
    bool allow_empty = false
    )

Constructs a primitive descriptor for reorder primitive.

Parameters:

src

Source memory object. It is used to obtain the source memory descriptor and engine.

dst

Destination memory object. It is used to obtain the destination memory descriptor and engine.

attr

Primitive attributes to use (optional).

allow_empty

A flag signifying whether construction is allowed to fail without throwing an exception. In this case an empty object will be produced. This flag is optional and defaults to false.

primitive_desc(dnnl_primitive_desc_t pd)

Constructs a primitive descriptor for reorder primitive from a C API primitive descriptor which must have a matching kind.

Parameters:

pd

C API primitive descriptor for reorder primitive.

engine get_src_engine() const

Returns the engine on which the source memory is allocated.

Returns:

The engine on which the source memory is allocated.

engine get_dst_engine() const

Returns the engine on which the destination memory is allocated.

Returns:

The engine on which the destination memory is allocated.

memory::desc src_desc() const

Returns a source memory descriptor.

Returns:

Source memory descriptor.

A zero memory descriptor if the primitive does not have a source parameter.

memory::desc dst_desc() const

Returns a destination memory descriptor.

Returns:

Destination memory descriptor.

A zero memory descriptor if the primitive does not have a destination parameter.