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

Reorder primitive. More...

#include <dnnl.hpp>

Inheritance diagram for dnnl::reorder:
Inheritance graph
[legend]
Collaboration diagram for dnnl::reorder:
Collaboration graph
[legend]

Classes

struct  primitive_desc
 Primitive descriptor for a reorder primitive. More...
 

Public Member Functions

 reorder ()=default
 Default constructor. Produces an empty object.
 
 reorder (const primitive_desc &pd)
 Constructs a reorder primitive. More...
 
 reorder (const memory &src, const memory &dst, const primitive_attr &attr=primitive_attr())
 Constructs a reorder primitive that would reorder data between memory objects having the same memory descriptors as memory objects src and dst. More...
 
void execute (stream stream, memory &src, memory &dst) const
 Executes the reorder primitive. More...
 
void execute (stream &stream, const std::unordered_map< int, memory > &args) const
 Executes computations specified by the primitive in a specified stream. More...
 
- Public Member Functions inherited from dnnl::primitive
 primitive ()=default
 Default constructor. Constructs an empty object.
 
 primitive (const_dnnl_primitive_desc_t c_pd)
 Constructs a primitive from a C API primitive descriptor. More...
 
 primitive (const primitive_desc &pd)
 Constructs a primitive from a primitive descriptor. More...
 
const_dnnl_primitive_desc_t get_primitive_desc () const
 Returns the C API primitive descriptor of the underlying C API primitive. More...
 
kind get_kind () const
 Returns the kind of the primitive. More...
 
void execute (stream &stream, const std::unordered_map< int, memory > &args) const
 Executes computations specified by the primitive in a specified stream. More...
 
 handle ()=default
 Constructs an empty handle object. More...
 
 handle (const handle< T, traits > &)=default
 Copy constructor.
 
 handle (handle< T, traits > &&)=default
 Move constructor.
 
 handle (T t, bool weak=false)
 Constructs a handle wrapper object from a C API handle. More...
 
- Public Member Functions inherited from dnnl::handle< dnnl_primitive_t >
bool operator== (const handle< dnnl_primitive_t, handle_traits< dnnl_primitive_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_t, handle_traits< dnnl_primitive_t > > &)=default
 Copy constructor.
 
 handle (handle< dnnl_primitive_t, handle_traits< dnnl_primitive_t > > &&)=default
 Move constructor.
 
 handle (dnnl_primitive_t t, bool weak=false)
 Constructs a handle wrapper object from a C API handle. More...
 
handle< dnnl_primitive_t, handle_traits< dnnl_primitive_t > > & operator= (const handle< dnnl_primitive_t, handle_traits< dnnl_primitive_t > > &)=default
 Assignment operator.
 
handle< dnnl_primitive_t, handle_traits< dnnl_primitive_t > > & operator= (handle< dnnl_primitive_t, handle_traits< dnnl_primitive_t > > &&)=default
 Move assignment operator.
 
void reset (dnnl_primitive_t t, bool weak=false)
 Resets the handle wrapper objects to wrap a new C API handle. More...
 
dnnl_primitive_t get (bool allow_empty=false) const
 Returns the underlying C API handle. More...
 
 operator dnnl_primitive_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

- Public Types inherited from dnnl::primitive
enum  kind
 Kinds of primitives supported by the library. More...
 

Detailed Description

Reorder primitive.

Examples:
cnn_inference_f32.cpp, cnn_inference_int8.cpp, cnn_training_f32.cpp, cpu_cnn_training_bf16.cpp, cpu_matmul_quantization.cpp, cpu_rnn_inference_f32.cpp, cpu_rnn_inference_int8.cpp, cross_engine_reorder.cpp, inference_int8_matmul.cpp, memory_format_propagation.cpp, performance_profiling.cpp, and rnn_training_f32.cpp.

Constructor & Destructor Documentation

◆ reorder() [1/2]

dnnl::reorder::reorder ( const primitive_desc pd)
inline

Constructs a reorder primitive.

Parameters
pdPrimitive descriptor for reorder primitive.

◆ reorder() [2/2]

dnnl::reorder::reorder ( const memory src,
const memory dst,
const primitive_attr attr = primitive_attr() 
)
inline

Constructs a reorder primitive that would reorder data between memory objects having the same memory descriptors as memory objects src and dst.

Parameters
srcSource memory object.
dstDestination memory object.
attrPrimitive attributes to use (optional).

Member Function Documentation

◆ execute() [1/2]

void dnnl::reorder::execute ( stream  stream,
memory src,
memory dst 
) const
inline

Executes the reorder primitive.

Parameters
streamStream object. The stream must belong to the same engine as the primitive.
srcSource memory object.
dstDestination memory object.
Examples:
cnn_inference_f32.cpp, cpu_matmul_quantization.cpp, cpu_rnn_inference_f32.cpp, cpu_rnn_inference_int8.cpp, inference_int8_matmul.cpp, performance_profiling.cpp, and rnn_training_f32.cpp.

◆ execute() [2/2]

void dnnl::primitive::execute

Executes computations specified by the primitive in a specified stream.

Arguments are passed via an arguments map containing <index, memory object> pairs. The index must be one of the DNNL_ARG_* values such as DNNL_ARG_SRC, and the memory must have a memory descriptor matching the one returned by primitive_desc::query_md(query::exec_arg_md, index) unless using dynamic shapes (see DNNL_RUNTIME_DIM_VAL).

Parameters
streamStream object. The stream must belong to the same engine as the primitive.
argsArguments map.

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