Deep Neural Network Library (DNNL)  1.1.3
Performance library for Deep Learning
Public Member Functions | Public Attributes | List of all members
dnnl::memory::desc Struct Reference

A memory descriptor. More...

#include <dnnl.hpp>

Collaboration diagram for dnnl::memory::desc:
Collaboration graph
[legend]

Public Member Functions

 desc ()
 Constructs a zero memory descriptor.
 
 desc (const dims &adims, data_type adata_type, format_tag aformat_tag)
 Constructs a memory descriptor. More...
 
 desc (const dims &adims, data_type adata_type, const dims &astrides)
 Constructs a memory descriptor by strides. More...
 
 desc (const dnnl_memory_desc_t &adata)
 Constructs a memory descriptor from a C API data structure. More...
 
desc submemory_desc (const dims &adims, const dims &offsets)
 Constructs a sub-memory descriptor. More...
 
desc reshape (const dims &adims)
 Constructs a memory descriptor by reshaping existing one.
 
size_t get_size () const
 Returns the number of bytes required to allocate the memory described including the padding area. More...
 
bool is_zero () const
 Returns true if the memory descriptor describes an empty memory.
 

Public Attributes

dnnl_memory_desc_t data
 The underlying C API data structure.
 

Detailed Description

A memory descriptor.

Examples:
cnn_inference_f32.cpp, cnn_inference_int8.cpp, cnn_training_f32.cpp, cpu_cnn_training_bf16.cpp, cpu_rnn_inference_f32.cpp, cpu_rnn_inference_int8.cpp, getting_started.cpp, gpu_opencl_interop.cpp, memory_format_propagation.cpp, performance_profiling.cpp, and rnn_training_f32.cpp.

Constructor & Destructor Documentation

◆ desc() [1/3]

dnnl::memory::desc::desc ( const dims &  adims,
data_type  adata_type,
format_tag  aformat_tag 
)
inline

Constructs a memory descriptor.

Parameters
adimsData dimensions
adata_typeData precision/type.
aformat_tagData layout format tag.

◆ desc() [2/3]

dnnl::memory::desc::desc ( const dims &  adims,
data_type  adata_type,
const dims &  astrides 
)
inline

Constructs a memory descriptor by strides.

Parameters
adimsData dimensions
adata_typeData precision/type.
astridesThe strides for dimensions.

◆ desc() [3/3]

dnnl::memory::desc::desc ( const dnnl_memory_desc_t adata)
inline

Constructs a memory descriptor from a C API data structure.

Parameters
adataA C API dnnl_memory_desc_t structure.

Member Function Documentation

◆ submemory_desc()

desc dnnl::memory::desc::submemory_desc ( const dims &  adims,
const dims &  offsets 
)
inline

Constructs a sub-memory descriptor.

Parameters
adimsSizes of a sub-memory
offsetsOffsets of a sub-memory
Examples:
cpu_rnn_inference_f32.cpp, cpu_rnn_inference_int8.cpp, and rnn_training_f32.cpp.

◆ get_size()

size_t dnnl::memory::desc::get_size ( ) const
inline

Returns the number of bytes required to allocate the memory described including the padding area.

Examples:
cpu_rnn_inference_f32.cpp, cpu_rnn_inference_int8.cpp, and performance_profiling.cpp.

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