Developer Guide and Reference

  • 2022.1
  • 04/11/2022
  • Public Content
Contents

struct dnnl::sum::primitive_desc

Overview

Primitive descriptor for a sum primitive. More…
#include <dnnl.hpp> struct primitive_desc: public dnnl::primitive_desc_base { // construction primitive_desc(); primitive_desc( const memory::desc& dst, const std::vector<float>& scales, const std::vector<memory::desc>& srcs, const engine& aengine, const primitive_attr& attr = primitive_attr() ); primitive_desc( const std::vector<float>& scales, const std::vector<memory::desc>& srcs, const engine& aengine, const primitive_attr& attr = primitive_attr() ); primitive_desc(dnnl_primitive_desc_t pd); // methods memory::desc src_desc(int idx = 0) const; memory::desc dst_desc() const; primitive_desc_base(); primitive_desc_base(dnnl_primitive_desc_t pd, dnnl::primitive::kind prim_kind); primitive_desc_base( dnnl_primitive_desc_t pd, dnnl::primitive::kind prim_kind, dnnl::prop_kind aprop_kind ); primitive_desc_base( dnnl_primitive_desc_t pd, dnnl::primitive::kind prim_kind, dnnl::prop_kind prop_kind1, dnnl::prop_kind prop_kind2 ); };
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::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 sum primitive.
Construction
primitive_desc()
Default constructor. Produces an empty object.
primitive_desc( const memory::desc& dst, const std::vector<float>& scales, const std::vector<memory::desc>& srcs, const engine& aengine, const primitive_attr& attr = primitive_attr() )
Constructs a primitive descriptor for a sum primitive.
Parameters:
dst
Destination memory descriptor.
scales
Vector of scales to multiply data in each source memory by.
srcs
Vector of source memory descriptors.
aengine
Engine to perform the operation on.
attr
Primitive attributes to use (optional).
primitive_desc( const std::vector<float>& scales, const std::vector<memory::desc>& srcs, const engine& aengine, const primitive_attr& attr = primitive_attr() )
Constructs a primitive descriptor for a sum primitive.
This version derives the destination memory descriptor automatically.
Parameters:
scales
Vector of scales by which to multiply data in each source memory object.
srcs
Vector of source memory descriptors.
aengine
Engine on which to perform the operation.
attr
Primitive attributes to use (optional).
primitive_desc(dnnl_primitive_desc_t pd)
Constructs a primitive descriptor for sum primitive from a C API primitive descriptor which must have a matching kind.
Parameters:
pd
C API primitive descriptor for reorder primitive.
Methods
memory::desc src_desc(int idx = 0) const
Returns a source memory descriptor.
Parameters:
idx
Source index.
Returns:
Source memory descriptor.
A zero memory descriptor if the primitive does not have a source parameter with index
idx
.
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.
primitive_desc_base()
Default constructor. Produces an empty object.
primitive_desc_base(dnnl_primitive_desc_t pd, dnnl::primitive::kind prim_kind)
Constructs a primitive descriptor base object from a clone of a C API primitive descriptor after verifying that it is what the caller expects.
The
prim_kind
should map to a primitive that does not have different values of propagation kind (e.g. dnnl::binary).
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( dnnl_primitive_desc_t pd, dnnl::primitive::kind prim_kind, dnnl::prop_kind aprop_kind )
Constructs a primitive descriptor base object from a clone of a C API primitive descriptor after verifying that it is what the caller expects.
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( dnnl_primitive_desc_t pd, dnnl::primitive::kind prim_kind, dnnl::prop_kind prop_kind1, dnnl::prop_kind prop_kind2 )
Constructs a primitive descriptor base object from a clone of a C API primitive descriptor after verifying that it is what the caller expects.
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.

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.