Deep Neural Network Library (DNNL)  1.3.0
Performance library for Deep Learning
Public Member Functions | List of all members
dnnl::sum::primitive_desc Struct Reference

Primitive descriptor for a sum primitive. More...

#include <dnnl.hpp>

Inheritance diagram for dnnl::sum::primitive_desc:
Inheritance graph
[legend]
Collaboration diagram for dnnl::sum::primitive_desc:
Collaboration graph
[legend]

Public Member Functions

 primitive_desc ()=default
 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 &engine, const primitive_attr &attr=primitive_attr())
 Constructs a primitive descriptor for a sum primitive. More...
 
 primitive_desc (const std::vector< float > &scales, const std::vector< memory::desc > &srcs, const engine &engine, const primitive_attr &attr=primitive_attr())
 Constructs a primitive descriptor for a sum primitive. More...
 
 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. More...
 
memory::desc src_desc (int idx=0) const
 Returns a source memory descriptor. More...
 
memory::desc dst_desc () const
 Returns a destination memory descriptor. More...
 
 primitive_desc_base ()=default
 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. More...
 
 primitive_desc_base (dnnl_primitive_desc_t pd, dnnl::primitive::kind prim_kind, dnnl::prop_kind prop_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. More...
 
 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. More...
 
- Public Member Functions inherited from dnnl::primitive_desc_base
 primitive_desc_base ()=default
 Default constructor. Produces an empty object.
 
engine get_engine () const
 Returns the engine of the primitive descriptor. More...
 
const char * impl_info_str () const
 Returns implementation name. More...
 
memory::dim query_s64 (query what) const
 Returns a memory::dim value (same as int64_t). More...
 
memory::desc query_md (query what, int idx=0) const
 Returns a memory descriptor. More...
 
memory::desc src_desc (int idx) const
 Returns a source memory descriptor. More...
 
memory::desc dst_desc (int idx) const
 Returns a destination memory descriptor. More...
 
memory::desc weights_desc (int idx) const
 Returns a weights memory descriptor. More...
 
memory::desc diff_src_desc (int idx) const
 Returns a diff source memory descriptor. More...
 
memory::desc diff_dst_desc (int idx) const
 Returns a diff destination memory descriptor. More...
 
memory::desc diff_weights_desc (int idx) const
 Returns a diff weights memory descriptor. More...
 
memory::desc src_desc () const
 Returns a source memory descriptor. More...
 
memory::desc dst_desc () const
 Returns a destination memory descriptor. More...
 
memory::desc weights_desc () const
 Returns a weights memory descriptor. More...
 
memory::desc diff_src_desc () const
 Returns a diff source memory descriptor. More...
 
memory::desc diff_dst_desc () const
 Returns a diff destination memory descriptor. More...
 
memory::desc diff_weights_desc () const
 Returns a diff weights memory descriptor. More...
 
memory::desc workspace_desc () const
 Returns the workspace memory descriptor. More...
 
memory::desc scratchpad_desc () const
 Returns the scratchpad memory descriptor. More...
 
engine scratchpad_engine () const
 Returns the engine on which the scratchpad memory is located. More...
 
primitive_attr get_primitive_attr () const
 Returns the primitive attributes. More...
 
dnnl::primitive::kind get_kind () const
 Returns the kind of the primitive descriptor. More...
 
- Public Member Functions inherited from dnnl::handle< dnnl_primitive_desc_t >
bool operator== (const handle< dnnl_primitive_desc_t, handle_traits< dnnl_primitive_desc_t > > &other) const
 Equality operator. More...
 
bool operator!= (const handle &other) const
 Inequality operator. More...
 
 handle ()=default
 Constructs an empty handle object. More...
 
 handle (const handle< dnnl_primitive_desc_t, handle_traits< dnnl_primitive_desc_t > > &)=default
 Copy constructor.
 
 handle (handle< dnnl_primitive_desc_t, handle_traits< dnnl_primitive_desc_t > > &&)=default
 Move constructor.
 
 handle (dnnl_primitive_desc_t t, bool weak=false)
 Constructs a handle wrapper object from a C API handle. More...
 
handle< dnnl_primitive_desc_t, handle_traits< dnnl_primitive_desc_t > > & operator= (const handle< dnnl_primitive_desc_t, handle_traits< dnnl_primitive_desc_t > > &)=default
 Assignment operator.
 
handle< dnnl_primitive_desc_t, handle_traits< dnnl_primitive_desc_t > > & operator= (handle< dnnl_primitive_desc_t, handle_traits< dnnl_primitive_desc_t > > &&)=default
 Move assignment operator.
 
void reset (dnnl_primitive_desc_t t, bool weak=false)
 Resets the handle wrapper objects to wrap a new C API handle. More...
 
dnnl_primitive_desc_t get (bool allow_empty=false) const
 Returns the underlying C API handle. More...
 
 operator dnnl_primitive_desc_t () const
 Converts a handle to the underlying C API handle type. More...
 
 operator bool () const
 Checks whether the object is empty. More...
 

Additional Inherited Members

- Protected Member Functions inherited from dnnl::primitive_desc_base
void reset_with_clone (const_dnnl_primitive_desc_t pd)
 Resets the value of the handle to a clone of a C API primitive descriptor. More...
 
 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. More...
 
 primitive_desc_base (dnnl_primitive_desc_t pd, dnnl::primitive::kind prim_kind, dnnl::prop_kind prop_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. More...
 
 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. More...
 

Detailed Description

Primitive descriptor for a sum primitive.

Constructor & Destructor Documentation

◆ primitive_desc() [1/3]

dnnl::sum::primitive_desc::primitive_desc ( const memory::desc dst,
const std::vector< float > &  scales,
const std::vector< memory::desc > &  srcs,
const engine engine,
const primitive_attr attr = primitive_attr() 
)
inline

Constructs a primitive descriptor for a sum primitive.

Inputs:

Outputs:

Parameters
dstDestination memory descriptor.
scalesVector of scales to multiply data in each source memory by.
srcsVector of source memory descriptors.
engineEngine to perform the operation on.
attrPrimitive attributes to use (optional).

◆ primitive_desc() [2/3]

dnnl::sum::primitive_desc::primitive_desc ( const std::vector< float > &  scales,
const std::vector< memory::desc > &  srcs,
const engine engine,
const primitive_attr attr = primitive_attr() 
)
inline

Constructs a primitive descriptor for a sum primitive.

This version derives the destination memory descriptor automatically.

Parameters
scalesVector of scales by which to multiply data in each source memory object.
srcsVector of source memory descriptors.
engineEngine on which to perform the operation.
attrPrimitive attributes to use (optional).

◆ primitive_desc() [3/3]

dnnl::sum::primitive_desc::primitive_desc ( dnnl_primitive_desc_t  pd)
inline

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

Parameters
pdC API primitive descriptor for reorder primitive.

Member Function Documentation

◆ src_desc()

memory::desc dnnl::sum::primitive_desc::src_desc ( int  idx = 0) const
inline

Returns a source memory descriptor.

Parameters
idxSource index.
Returns
Source memory descriptor.
A zero memory descriptor if the primitive does not have a source parameter with index pdx.

◆ dst_desc()

memory::desc dnnl::sum::primitive_desc::dst_desc ( ) const
inline

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() [1/3]

dnnl::primitive_desc_base::primitive_desc_base
inline

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).
Primitive descriptor base constructed this way does not support next_impl() (will throw).
Parameters
pdC API primitive descriptor to clone.
prim_kindExpected primitive kind.

◆ primitive_desc_base() [2/3]

dnnl::primitive_desc_base::primitive_desc_base
inline

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
pdC API primitive descriptor to clone.
prim_kindExpected primitive kind.
prop_kindExpected propagation kind.

◆ primitive_desc_base() [3/3]

dnnl::primitive_desc_base::primitive_desc_base
inline

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
pdC API primitive descriptor to clone.
prim_kindExpected primitive kind.
prop_kind1Expected propagation kind (option 1).
prop_kind2Expected propagation kind (option 2). This value is checked if the check with prop_kind1 fails.

The documentation for this struct was generated from the following file: