Developer Guide and Reference

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

struct dnnl::primitive_desc_base

Overview

Base class for all primitive descriptors. More…
#include <dnnl.hpp> struct primitive_desc_base: public dnnl::handle { // methods 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; }; // direct descendants 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;

Detailed Documentation

Base class for all primitive descriptors.
Methods
engine get_engine() const
Returns the engine of the primitive descriptor.
Returns:
The engine of the primitive descriptor.
const char* impl_info_str() const
Returns implementation name.
Returns:
The implementation name.
memory::dim query_s64(query what) const
Returns a memory::dim value (same as int64_t).
Parameters:
what
The value to query.
Returns:
The result of the query.
memory::desc query_md(query what, int idx = 0) const
Returns a memory descriptor.
There are also convenience methods dnnl::primitive_desc_base::src_desc(), dnnl::primitive_desc_base::dst_desc(), and others.
Parameters:
what
The kind of parameter to query; can be dnnl::query::src_md, dnnl::query::dst_md, etc.
idx
Index of the parameter. For example, convolution bias can be queried with what = dnnl::query::weights_md and idx = 1.
Returns:
The requested memory descriptor.
A zero memory descriptor if the primitive does not have a parameter of the specified kind or index.
memory::desc src_desc(int idx) 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(int idx) const
Returns a destination memory descriptor.
Parameters:
idx
Destination index.
Returns:
Destination memory descriptor.
A zero memory descriptor if the primitive does not have a destination parameter with index
idx
.
memory::desc weights_desc(int idx) const
Returns a weights memory descriptor.
Parameters:
idx
Weights index.
Returns:
Weights memory descriptor.
A zero memory descriptor if the primitive does not have a weights parameter with index
idx
.
memory::desc diff_src_desc(int idx) const
Returns a diff source memory descriptor.
Parameters:
idx
Diff source index.
Returns:
Diff source memory descriptor.
A zero memory descriptor if the primitive does not have a diff source parameter with index
idx
.
memory::desc diff_dst_desc(int idx) const
Returns a diff destination memory descriptor.
Parameters:
idx
Diff destination index.
Returns:
Diff destination memory descriptor.
A zero memory descriptor if the primitive does not have a diff destination parameter with index
idx
.
memory::desc diff_weights_desc(int idx) const
Returns a diff weights memory descriptor.
Parameters:
idx
Diff weights index.
Returns:
Diff weights memory descriptor.
A zero memory descriptor if the primitive does not have a diff weights parameter with index
idx
.
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.
memory::desc weights_desc() const
Returns a weights memory descriptor.
Returns:
Weights memory descriptor.
A zero memory descriptor if the primitive does not have a weights parameter.
memory::desc diff_src_desc() const
Returns a diff source memory descriptor.
Returns:
Diff source memory descriptor.
A zero memory descriptor if the primitive does not have a diff source memory with.
memory::desc diff_dst_desc() const
Returns a diff destination memory descriptor.
Returns:
Diff destination memory descriptor.
A zero memory descriptor if the primitive does not have a diff destination parameter.
memory::desc diff_weights_desc() const
Returns a diff weights memory descriptor.
Returns:
Diff weights memory descriptor.
A zero memory descriptor if the primitive does not have a diff weights parameter.
memory::desc workspace_desc() const
Returns the workspace memory descriptor.
Returns:
Workspace memory descriptor.
A zero memory descriptor if the primitive does not require workspace parameter.
memory::desc scratchpad_desc() const
Returns the scratchpad memory descriptor.
Returns:
scratchpad memory descriptor.
A zero memory descriptor if the primitive does not require scratchpad parameter.
See also:
engine scratchpad_engine() const
Returns the engine on which the scratchpad memory is located.
Returns:
The engine on which the scratchpad memory is located.
primitive_attr get_primitive_attr() const
Returns the primitive attributes.
Returns:
The primitive attributes.
dnnl::primitive::kind get_kind() const
Returns the kind of the primitive descriptor.
Returns:
The kind of the primitive descriptor.
std::vector<uint8_t> get_cache_blob_id() const
Returns the cache blob ID of the primitive descriptor.
Returns:
The cache blob ID of the primitive descriptor.

Product and Performance Information

1

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