Common operations to create, destroy and inspect primitives. More...
Classes | |
struct | dnnl::primitive |
Base class for all computational primitives. More... | |
struct | dnnl::primitive_desc_base |
Base class for all primitive descriptors. More... | |
struct | dnnl::primitive_desc |
A base class for descriptors of all primitives that have an operation descriptor and that support iteration over multiple implementations. More... | |
struct | dnnl_exec_arg_t |
A structure that contains an index and a memory object, and is used to pass arguments to dnnl_primitive_execute(). More... | |
struct | dnnl_primitive_desc_iterator |
An opaque structure to describe a primitive descriptor iterator. More... | |
struct | dnnl_primitive_desc |
An opaque structure to describe a primitive descriptor. More... | |
struct | dnnl_primitive |
An opaque structure to describe a primitive. More... | |
Macros | |
#define | DNNL_ARG_SRC_0 1 |
Source argument #0. | |
#define | DNNL_ARG_SRC DNNL_ARG_SRC_0 |
A special mnemonic for source argument for primitives that have a single source. More... | |
#define | DNNL_ARG_SRC_LAYER DNNL_ARG_SRC_0 |
A special mnemonic for RNN input vector. More... | |
#define | DNNL_ARG_FROM DNNL_ARG_SRC_0 |
A special mnemonic for reorder source argument. More... | |
#define | DNNL_ARG_SRC_1 2 |
Source argument #1. | |
#define | DNNL_ARG_SRC_ITER DNNL_ARG_SRC_1 |
A special mnemonic for RNN input recurrent hidden state vector. More... | |
#define | DNNL_ARG_SRC_2 3 |
Source argument #2. | |
#define | DNNL_ARG_SRC_ITER_C DNNL_ARG_SRC_2 |
A special mnemonic for RNN input recurrent cell state vector. More... | |
#define | DNNL_ARG_DST_0 17 |
Destination argument #0. | |
#define | DNNL_ARG_DST DNNL_ARG_DST_0 |
A special mnemonic for destination argument for primitives that have a single destination. More... | |
#define | DNNL_ARG_TO DNNL_ARG_DST_0 |
A special mnemonic for reorder destination argument. More... | |
#define | DNNL_ARG_DST_LAYER DNNL_ARG_DST_0 |
A special mnemonic for RNN output vector. An alias for DNNL_ARG_DST_0. | |
#define | DNNL_ARG_DST_1 18 |
Destination argument #1. | |
#define | DNNL_ARG_DST_ITER DNNL_ARG_DST_1 |
A special mnemonic for RNN input recurrent hidden state vector. More... | |
#define | DNNL_ARG_DST_2 19 |
Destination argument #2. | |
#define | DNNL_ARG_DST_ITER_C DNNL_ARG_DST_2 |
A special mnemonic for LSTM output recurrent cell state vector. More... | |
#define | DNNL_ARG_WEIGHTS_0 33 |
Weights argument #0. | |
#define | DNNL_ARG_WEIGHTS DNNL_ARG_WEIGHTS_0 |
A special mnemonic for primitives that have a single weights argument. More... | |
#define | DNNL_ARG_SCALE_SHIFT DNNL_ARG_WEIGHTS_0 |
A special mnemonic for scale and shift argument of normalization primitives. More... | |
#define | DNNL_ARG_WEIGHTS_LAYER DNNL_ARG_WEIGHTS_0 |
A special mnemonic for RNN weights applied to the layer input. More... | |
#define | DNNL_ARG_WEIGHTS_1 34 |
Weights argument #1. | |
#define | DNNL_ARG_WEIGHTS_ITER DNNL_ARG_WEIGHTS_1 |
A special mnemonic for RNN weights applied to the recurrent input. More... | |
#define | DNNL_ARG_WEIGHTS_2 35 |
Weights argument #2. | |
#define | DNNL_ARG_WEIGHTS_PEEPHOLE DNNL_ARG_WEIGHTS_2 |
A special mnemonic for RNN weights applied to the peephole weights. More... | |
#define | DNNL_ARG_BIAS 41 |
Bias tensor argument. | |
#define | DNNL_ARG_MEAN 49 |
Mean values tensor argument. | |
#define | DNNL_ARG_VARIANCE 50 |
Variance values tensor argument. | |
#define | DNNL_ARG_WORKSPACE 64 |
Workspace tensor argument. More... | |
#define | DNNL_ARG_SCRATCHPAD 80 |
Scratchpad (temporary storage) tensor argument. | |
#define | DNNL_ARG_DIFF_SRC_0 129 |
Gradient (diff) of the source argument #0. | |
#define | DNNL_ARG_DIFF_SRC DNNL_ARG_DIFF_SRC_0 |
A special mnemonic for primitives that have a single diff source argument. More... | |
#define | DNNL_ARG_DIFF_SRC_LAYER DNNL_ARG_DIFF_SRC_0 |
A special mnemonic for gradient (diff) of RNN input vector. More... | |
#define | DNNL_ARG_DIFF_SRC_1 130 |
Gradient (diff) of the source argument #1. | |
#define | DNNL_ARG_DIFF_SRC_ITER DNNL_ARG_DIFF_SRC_1 |
A special mnemonic for gradient (diff) of RNN input recurrent hidden state vector. More... | |
#define | DNNL_ARG_DIFF_SRC_2 131 |
Gradient (diff) of the source argument #2. | |
#define | DNNL_ARG_DIFF_SRC_ITER_C DNNL_ARG_DIFF_SRC_2 |
A special mnemonic for gradient (diff) of RNN input recurrent cell state vector. More... | |
#define | DNNL_ARG_DIFF_DST_0 145 |
Gradient (diff) of the destination argument #0. | |
#define | DNNL_ARG_DIFF_DST DNNL_ARG_DIFF_DST_0 |
A special mnemonic for primitives that have a single diff destination argument. More... | |
#define | DNNL_ARG_DIFF_DST_LAYER DNNL_ARG_DIFF_DST_0 |
A special mnemonic for gradient (diff) of RNN output vector. More... | |
#define | DNNL_ARG_DIFF_DST_1 146 |
Gradient (diff) of the destination argument #1. | |
#define | DNNL_ARG_DIFF_DST_ITER DNNL_ARG_DIFF_DST_1 |
A special mnemonic for gradient (diff) of RNN input recurrent hidden state vector. More... | |
#define | DNNL_ARG_DIFF_DST_2 147 |
Gradient (diff) of the destination argument #2. | |
#define | DNNL_ARG_DIFF_DST_ITER_C DNNL_ARG_DIFF_DST_2 |
A special mnemonic for gradient (diff) of RNN input recurrent cell state vector. More... | |
#define | DNNL_ARG_DIFF_WEIGHTS_0 161 |
Gradient (diff) of the weights argument #0. | |
#define | DNNL_ARG_DIFF_WEIGHTS DNNL_ARG_DIFF_WEIGHTS_0 |
A special mnemonic for primitives that have a single diff weights argument. More... | |
#define | DNNL_ARG_DIFF_SCALE_SHIFT DNNL_ARG_DIFF_WEIGHTS_0 |
A special mnemonic for diff of scale and shift argument of normalization primitives. More... | |
#define | DNNL_ARG_DIFF_WEIGHTS_LAYER DNNL_ARG_DIFF_WEIGHTS_0 |
A special mnemonic for diff of RNN weights applied to the layer input. More... | |
#define | DNNL_ARG_DIFF_WEIGHTS_1 162 |
Gradient (diff) of the weights argument #1. | |
#define | DNNL_ARG_DIFF_WEIGHTS_ITER DNNL_ARG_DIFF_WEIGHTS_1 |
A special mnemonic for diff of RNN weights applied to the recurrent input. More... | |
#define | DNNL_ARG_DIFF_WEIGHTS_2 163 |
Gradient (diff) of the weights argument #2. | |
#define | DNNL_ARG_DIFF_WEIGHTS_PEEPHOLE DNNL_ARG_DIFF_WEIGHTS_2 |
A special mnemonic for diff of RNN weights applied to the peephole weights. More... | |
#define | DNNL_ARG_DIFF_BIAS 169 |
Gradient (diff) of the bias tensor argument. | |
#define | DNNL_ARG_ATTR_OUTPUT_SCALES 513 |
Output scaling factors provided at execution time. | |
#define | DNNL_ARG_MULTIPLE_SRC 1024 |
Starting index for source arguments for primitives that take a variable number of source arguments. More... | |
#define | DNNL_ARG_MULTIPLE_DST 2048 |
Starting index for destination arguments for primitives that produce a variable number of destination arguments. More... | |
#define | DNNL_ARG_ATTR_ZERO_POINTS 4096 |
Zero points provided at execution time. | |
#define | DNNL_ARG_ATTR_POST_OP_DW 8192 |
Arguments for fused depthwise convolution. More... | |
Typedefs | |
typedef void * | dnnl_op_desc_t |
A pointer to any of the operation descriptors. | |
typedef const void * | const_dnnl_op_desc_t |
A pointer to any of the operation descriptors (constant variant). | |
typedef struct dnnl_primitive_desc_iterator * | dnnl_primitive_desc_iterator_t |
A primitive descriptor iterator handle. | |
typedef const struct dnnl_primitive_desc_iterator * | const_dnnl_primitive_desc_iterator_t |
A constant primitive descriptor iterator handle. | |
typedef struct dnnl_primitive_desc * | dnnl_primitive_desc_t |
A primitive descriptor handle. | |
typedef const struct dnnl_primitive_desc * | const_dnnl_primitive_desc_t |
A constant primitive descriptor handle. | |
typedef struct dnnl_primitive * | dnnl_primitive_t |
A primitive handle. | |
typedef const struct dnnl_primitive * | const_dnnl_primitive_t |
A constant primitive handle. | |
Enumerations | |
enum | dnnl::normalization_flags : unsigned |
Flags for normalization primitives. More... | |
enum | dnnl::query |
Primitive descriptor query specification. More... | |
enum | dnnl_prop_kind_t |
Kinds of propagation. More... | |
enum | dnnl_primitive_kind_t |
Kinds of primitives. More... | |
enum | dnnl_alg_kind_t |
Kinds of algorithms. More... | |
enum | dnnl_normalization_flags_t |
Flags for batch normalization primitive. More... | |
enum | dnnl_query_t |
Primitive descriptor query specification. More... | |
Functions | |
dnnl_status_t DNNL_API | dnnl_primitive_desc_iterator_create (dnnl_primitive_desc_iterator_t *iterator, const_dnnl_op_desc_t op_desc, const_dnnl_primitive_attr_t attr, dnnl_engine_t engine, const_dnnl_primitive_desc_t hint_forward_primitive_desc) |
Creates a primitive descriptor iterator. More... | |
dnnl_status_t DNNL_API | dnnl_primitive_desc_iterator_next (dnnl_primitive_desc_iterator_t iterator) |
Advances the primitive descriptor iterator to point to the next available implementation. More... | |
dnnl_primitive_desc_t DNNL_API | dnnl_primitive_desc_iterator_fetch (const_dnnl_primitive_desc_iterator_t iterator) |
Fetches the current primitive descriptor from a primitive descriptor iterator. More... | |
dnnl_status_t DNNL_API | dnnl_primitive_desc_iterator_destroy (dnnl_primitive_desc_iterator_t iterator) |
Destroys a primitive descriptor iterator. More... | |
dnnl_status_t DNNL_API | dnnl_primitive_desc_create (dnnl_primitive_desc_t *primitive_desc, const_dnnl_op_desc_t op_desc, const_dnnl_primitive_attr_t attr, dnnl_engine_t engine, const_dnnl_primitive_desc_t hint_forward_primitive_desc) |
Creates a primitive descriptor. More... | |
dnnl_status_t DNNL_API | dnnl_primitive_desc_clone (dnnl_primitive_desc_t *primitive_desc, const_dnnl_primitive_desc_t existing_primitive_desc) |
Clones a primitive descriptor. More... | |
dnnl_status_t DNNL_API | dnnl_primitive_desc_get_attr (const_dnnl_primitive_desc_t primitive_desc, const_dnnl_primitive_attr_t *attr) |
Returns a constant reference to the attributes of a primitive descriptor. More... | |
dnnl_status_t DNNL_API | dnnl_primitive_desc_destroy (dnnl_primitive_desc_t primitive_desc) |
Destroys a primitive descriptor. More... | |
dnnl_status_t DNNL_API | dnnl_primitive_desc_query (const_dnnl_primitive_desc_t primitive_desc, dnnl_query_t what, int index, void *result) |
Queries a primitive descriptor for various pieces of information. More... | |
const dnnl_memory_desc_t DNNL_API * | dnnl_primitive_desc_query_md (const_dnnl_primitive_desc_t primitive_desc, dnnl_query_t what, int index) |
Queries primitive descriptor for a memory descriptor. More... | |
int DNNL_API | dnnl_primitive_desc_query_s32 (const_dnnl_primitive_desc_t primitive_desc, dnnl_query_t what, int index) |
Queries primitive descriptor for a signed 32bit int. More... | |
dnnl_status_t DNNL_API | dnnl_primitive_create (dnnl_primitive_t *primitive, const_dnnl_primitive_desc_t primitive_desc) |
Creates a primitive. More... | |
dnnl_status_t DNNL_API | dnnl_primitive_execute (const_dnnl_primitive_t primitive, dnnl_stream_t stream, int nargs, const dnnl_exec_arg_t *args) |
Executes a primitive. More... | |
dnnl_status_t DNNL_API | dnnl_primitive_get_primitive_desc (const_dnnl_primitive_t primitive, const_dnnl_primitive_desc_t *primitive_desc) |
Retrieves a constant reference to the primitive descriptor of a given primitive. More... | |
dnnl_status_t DNNL_API | dnnl_primitive_destroy (dnnl_primitive_t primitive) |
Destroys a primitive. More... | |
dnnl_primitive_kind_t | dnnl::convert_to_c (primitive::kind kind) |
Converts primitive kind enum value from C++ API to C API type. More... | |
dnnl_normalization_flags_t | dnnl::convert_to_c (normalization_flags flags) |
Converts normalization flags enum value from C++ API to C API type. More... | |
dnnl_query_t | dnnl::convert_to_c (query query) |
Converts query enum value from C++ API to C API type. More... | |
const_dnnl_primitive_desc_t | dnnl::primitive::get_primitive_desc () const |
Returns the C API primitive descriptor of the underlying C API primitive. More... | |
kind | dnnl::primitive::get_kind () const |
Returns the kind of the primitive. More... | |
Common operations to create, destroy and inspect primitives.
#define DNNL_ARG_SRC DNNL_ARG_SRC_0 |
A special mnemonic for source argument for primitives that have a single source.
An alias for DNNL_ARG_SRC_0.
#define DNNL_ARG_SRC_LAYER DNNL_ARG_SRC_0 |
A special mnemonic for RNN input vector.
An alias for DNNL_ARG_SRC_0.
#define DNNL_ARG_FROM DNNL_ARG_SRC_0 |
A special mnemonic for reorder source argument.
An alias for DNNL_ARG_SRC_0.
#define DNNL_ARG_SRC_ITER DNNL_ARG_SRC_1 |
A special mnemonic for RNN input recurrent hidden state vector.
An alias for DNNL_ARG_SRC_1.
#define DNNL_ARG_SRC_ITER_C DNNL_ARG_SRC_2 |
A special mnemonic for RNN input recurrent cell state vector.
An alias for DNNL_ARG_SRC_2.
#define DNNL_ARG_DST DNNL_ARG_DST_0 |
A special mnemonic for destination argument for primitives that have a single destination.
An alias for DNNL_ARG_DST_0.
#define DNNL_ARG_TO DNNL_ARG_DST_0 |
A special mnemonic for reorder destination argument.
An alias for DNNL_ARG_DST_0.
#define DNNL_ARG_DST_ITER DNNL_ARG_DST_1 |
A special mnemonic for RNN input recurrent hidden state vector.
An alias for DNNL_ARG_DST_1.
#define DNNL_ARG_DST_ITER_C DNNL_ARG_DST_2 |
A special mnemonic for LSTM output recurrent cell state vector.
An alias for DNNL_ARG_DST_2.
#define DNNL_ARG_WEIGHTS DNNL_ARG_WEIGHTS_0 |
A special mnemonic for primitives that have a single weights argument.
Alias for DNNL_ARG_WEIGHTS_0.
#define DNNL_ARG_SCALE_SHIFT DNNL_ARG_WEIGHTS_0 |
A special mnemonic for scale and shift argument of normalization primitives.
Alias for DNNL_ARG_WEIGHTS_0.
#define DNNL_ARG_WEIGHTS_LAYER DNNL_ARG_WEIGHTS_0 |
A special mnemonic for RNN weights applied to the layer input.
An alias for DNNL_ARG_WEIGHTS_0.
#define DNNL_ARG_WEIGHTS_ITER DNNL_ARG_WEIGHTS_1 |
A special mnemonic for RNN weights applied to the recurrent input.
An alias for DNNL_ARG_WEIGHTS_1.
#define DNNL_ARG_WEIGHTS_PEEPHOLE DNNL_ARG_WEIGHTS_2 |
A special mnemonic for RNN weights applied to the peephole weights.
An alias for DNNL_ARG_WEIGHTS_2.
#define DNNL_ARG_WORKSPACE 64 |
Workspace tensor argument.
Workspace is used to pass information from forward propagation to backward propagation computations.
#define DNNL_ARG_DIFF_SRC DNNL_ARG_DIFF_SRC_0 |
A special mnemonic for primitives that have a single diff source argument.
An alias for DNNL_ARG_DIFF_SRC_0.
#define DNNL_ARG_DIFF_SRC_LAYER DNNL_ARG_DIFF_SRC_0 |
A special mnemonic for gradient (diff) of RNN input vector.
An alias for DNNL_ARG_DIFF_SRC_0.
#define DNNL_ARG_DIFF_SRC_ITER DNNL_ARG_DIFF_SRC_1 |
A special mnemonic for gradient (diff) of RNN input recurrent hidden state vector.
An alias for DNNL_ARG_DIFF_SRC_1.
#define DNNL_ARG_DIFF_SRC_ITER_C DNNL_ARG_DIFF_SRC_2 |
A special mnemonic for gradient (diff) of RNN input recurrent cell state vector.
An alias for DNNL_ARG_DIFF_SRC_1.
#define DNNL_ARG_DIFF_DST DNNL_ARG_DIFF_DST_0 |
A special mnemonic for primitives that have a single diff destination argument.
An alias for DNNL_ARG_DIFF_DST_0.
#define DNNL_ARG_DIFF_DST_LAYER DNNL_ARG_DIFF_DST_0 |
A special mnemonic for gradient (diff) of RNN output vector.
An alias for DNNL_ARG_DIFF_DST_0.
#define DNNL_ARG_DIFF_DST_ITER DNNL_ARG_DIFF_DST_1 |
A special mnemonic for gradient (diff) of RNN input recurrent hidden state vector.
An alias for DNNL_ARG_DIFF_DST_1.
#define DNNL_ARG_DIFF_DST_ITER_C DNNL_ARG_DIFF_DST_2 |
A special mnemonic for gradient (diff) of RNN input recurrent cell state vector.
An alias for DNNL_ARG_DIFF_DST_2.
#define DNNL_ARG_DIFF_WEIGHTS DNNL_ARG_DIFF_WEIGHTS_0 |
A special mnemonic for primitives that have a single diff weights argument.
Alias for DNNL_ARG_DIFF_WEIGHTS_0.
#define DNNL_ARG_DIFF_SCALE_SHIFT DNNL_ARG_DIFF_WEIGHTS_0 |
A special mnemonic for diff of scale and shift argument of normalization primitives.
Alias for DNNL_ARG_DIFF_WEIGHTS_0.
#define DNNL_ARG_DIFF_WEIGHTS_LAYER DNNL_ARG_DIFF_WEIGHTS_0 |
A special mnemonic for diff of RNN weights applied to the layer input.
An alias for DNNL_ARG_DIFF_WEIGHTS_0.
#define DNNL_ARG_DIFF_WEIGHTS_ITER DNNL_ARG_DIFF_WEIGHTS_1 |
A special mnemonic for diff of RNN weights applied to the recurrent input.
An alias for DNNL_ARG_DIFF_WEIGHTS_1.
#define DNNL_ARG_DIFF_WEIGHTS_PEEPHOLE DNNL_ARG_DIFF_WEIGHTS_2 |
A special mnemonic for diff of RNN weights applied to the peephole weights.
An alias for DNNL_ARG_DIFF_WEIGHTS_2.
#define DNNL_ARG_MULTIPLE_SRC 1024 |
Starting index for source arguments for primitives that take a variable number of source arguments.
#define DNNL_ARG_MULTIPLE_DST 2048 |
Starting index for destination arguments for primitives that produce a variable number of destination arguments.
#define DNNL_ARG_ATTR_POST_OP_DW 8192 |
Arguments for fused depthwise convolution.
|
strong |
Flags for normalization primitives.
Enumerator | |
---|---|
use_global_stats | Use global statistics. If specified, the library uses mean and variance provided by the user as an input on forward propagation and does not compute their derivatives on backward propagation. Otherwise, the library computes mean and variance on forward propagation for training and inference, outputs them on forward propagation for training, and computes the respective derivatives on backward propagation. |
use_scale_shift | Use scale and shift parameters. If specified, the user is expected to pass scale and shift as inputs on forward propagation. On backward propagation of type dnnl::prop_kind::backward, the library computes their derivatives. If not specified, the scale and shift parameters are not used by the library in any way. |
fuse_norm_relu | Fuse normalization with ReLU. On training, normalization will require the workspace to implement backward propagation. On inference, the workspace is not required and behavior is the same as when normalization is fused with ReLU using the post-ops API. |
|
strong |
Primitive descriptor query specification.
In general, queries are not used with the C++ API because most queries are implemented as class members.
See dnnl_query_t for more information.
Enumerator | |
---|---|
undef | no query |
engine | execution engine |
primitive_kind | primitive kind |
num_of_inputs_s32 | number of inputs expected |
num_of_outputs_s32 | number of outputs expected |
time_estimate_f64 | runtime estimation (seconds), unimplemented |
memory_consumption_s64 | memory consumption (bytes) extra (scratch) memory, additional to all inputs and outputs memory
|
scratchpad_engine | scratchpad engine engine to be used for creating scratchpad memory |
reorder_src_engine | reorder source engine |
reorder_dst_engine | reorder destination engine |
impl_info_str | implementation name |
prop_kind | propagation kind |
op_d | operation descriptor |
convolution_d | convolution descriptor |
deconvolution_d | deconvolution descriptor |
shuffle_d | shuffle descriptor |
eltwise_d | eltwise descriptor |
softmax_d | softmax descriptor |
pooling_d | pooling descriptor |
lrn_d | lrn descriptor |
batch_normalization_d | batch normalization descriptor |
layer_normalization_d | layer normalization descriptor |
inner_product_d | inner product descriptor |
rnn_d | rnn descriptor |
binary_d | binary descriptor |
logsoftmax_d | logsoftmax descriptor |
matmul_d | matmul descriptor |
resampling_d | resampling descriptor |
src_md | source memory desc |
diff_src_md | source gradient (diff) memory desc |
weights_md | weights memory descriptor desc |
diff_weights_md | weights gradient (diff) memory desc |
dst_md | destination memory desc |
diff_dst_md | destination gradient (diff) memory desc |
workspace_md | workspace memory desc |
scratchpad_md | scratchpad memory desc |
exec_arg_md | memory desc of an execute argument |
enum dnnl_prop_kind_t |
Kinds of propagation.
Kinds of primitives.
Used to implement a way to extend the library with new primitives without changing the ABI.
enum dnnl_alg_kind_t |
Kinds of algorithms.
Enumerator | |
---|---|
dnnl_convolution_direct | Direct convolution. |
dnnl_convolution_winograd | Winograd convolution. |
dnnl_convolution_auto | Convolution algorithm(either direct or Winograd) is chosen just in time. |
dnnl_deconvolution_direct | Direct deconvolution. |
dnnl_deconvolution_winograd | Winograd deconvolution. |
dnnl_eltwise_relu | Eltwise: ReLU. |
dnnl_eltwise_tanh | Eltwise: hyperbolic tangent non-linearity (tanh) |
dnnl_eltwise_elu | Eltwise: exponential linear unit (elu) |
dnnl_eltwise_square | Eltwise: square. |
dnnl_eltwise_abs | Eltwise: abs. |
dnnl_eltwise_sqrt | Eltwise: square root. |
dnnl_eltwise_linear | Eltwise: linear. |
dnnl_eltwise_bounded_relu | Eltwise: bounded_relu. |
dnnl_eltwise_soft_relu | Eltwise: soft_relu. |
dnnl_eltwise_logistic | Eltwise: logistic. |
dnnl_eltwise_exp | Eltwise: exponent. |
dnnl_eltwise_gelu_tanh | Eltwise: gelu.
|
dnnl_eltwise_gelu | Eltwise: tanh-based gelu (alias for dnnl_eltwise_gelu_tanh) |
dnnl_eltwise_swish | Eltwise: swish. |
dnnl_eltwise_log | Eltwise: natural logarithm. |
dnnl_eltwise_clip | Eltwise: clip. |
dnnl_eltwise_pow | Eltwise: pow. |
dnnl_eltwise_gelu_erf | Eltwise: erf-based gelu. |
dnnl_eltwise_relu_use_dst_for_bwd | Eltwise: ReLU (dst for backward) |
dnnl_eltwise_tanh_use_dst_for_bwd | Eltwise: hyperbolic tangent non-linearity (tanh) (dst for backward) |
dnnl_eltwise_elu_use_dst_for_bwd | Eltwise: exponential linear unit (elu) (dst for backward) |
dnnl_eltwise_sqrt_use_dst_for_bwd | Eltwise: square root (dst for backward) |
dnnl_eltwise_logistic_use_dst_for_bwd | Eltwise: logistic (dst for backward) |
dnnl_eltwise_exp_use_dst_for_bwd | Eltwise: exp (dst for backward) |
dnnl_pooling_max | Max pooling. |
dnnl_pooling_avg_include_padding | Average pooling include padding. |
dnnl_pooling_avg_exclude_padding | Average pooling exclude padding. |
dnnl_pooling_avg | Average pooling (alias for dnnl_pooling_avg_exclude_padding) |
dnnl_lrn_across_channels | Local response normalization (LRN) across multiple channels. |
dnnl_lrn_within_channel | LRN within a single channel. |
dnnl_vanilla_rnn | RNN cell. |
dnnl_vanilla_lstm | LSTM cell. |
dnnl_vanilla_gru | GRU cell. |
dnnl_lbr_gru | GRU cell with linear before reset. Modification of original GRU cell. Differs from dnnl_vanilla_gru in how the new memory gate is calculated: \[ c_t = tanh(W_c*x_t + b_{c_x} + r_t*(U_c*h_{t-1}+b_{c_h})) \] Primitive expects 4 biases on input: \([b_{u}, b_{r}, b_{c_x}, b_{c_h}]\) |
dnnl_binary_add | Binary add. |
dnnl_binary_mul | Binary mul. |
dnnl_binary_max | Binary max. |
dnnl_binary_min | Binary min. |
dnnl_resampling_nearest | Nearest Neighbor Resampling Method. |
dnnl_resampling_linear | Linear Resampling Method. |
Flags for batch normalization primitive.
Enumerator | |
---|---|
dnnl_use_global_stats | Use global statistics. If specified
If not specified:
|
dnnl_use_scaleshift | Use scale and shift parameters. If specified:
If no specified:
|
dnnl_fuse_norm_relu | Fuse with ReLU. The flag implies negative slope being 0. On training this is the only configuration supported. For inference, to use non-zero negative slope consider using Primitive Attributes: Post-ops. If specified:
|
enum dnnl_query_t |
Primitive descriptor query specification.
For generic function dnnl_primitive_desc_query(), the type of result must agree with the queried argument. The correspondence table:
Query kind | Type of query result ----— |
---|---|
dnnl_query_engine | dnnl_engine_t * |
dnnl_query_scratchpad_engine | dnnl_engine_t * |
dnnl_query_primitive_kind | dnnl_primitive_kind_t * |
dnnl_query_*_s32 | int * |
dnnl_query_*_s64 | dnnl_dim_t * (same as int64_t *) |
dnnl_query_*_f64 | double * |
dnnl_query_*_str | const char ** |
dnnl_query_op_d | const_dnnl_op_desc_t * |
dnnl_query_*_md | const dnnl_memory_desc_t ** |
dnnl_query_*_<op>_d | const dnnl_<op>_desc_t ** |
dnnl_query_*_pd | const_dnnl_primitive_desc_t * |
dnnl_status_t DNNL_API dnnl_primitive_desc_iterator_create | ( | dnnl_primitive_desc_iterator_t * | iterator, |
const_dnnl_op_desc_t | op_desc, | ||
const_dnnl_primitive_attr_t | attr, | ||
dnnl_engine_t | engine, | ||
const_dnnl_primitive_desc_t | hint_forward_primitive_desc | ||
) |
Creates a primitive descriptor iterator.
iterator | Output primitive descriptor iterator. |
op_desc | Operation descriptor. |
attr | Primitive attributes (can be NULL). |
engine | Engine to use. |
hint_forward_primitive_desc | For backward propagation: primitive descriptor for a respective forward propagation primitive. Pass NULL for forward propagation. |
dnnl_status_t DNNL_API dnnl_primitive_desc_iterator_next | ( | dnnl_primitive_desc_iterator_t | iterator | ) |
Advances the primitive descriptor iterator to point to the next available implementation.
iterator | A primitive descriptor iterator to advance. |
dnnl_primitive_desc_t DNNL_API dnnl_primitive_desc_iterator_fetch | ( | const_dnnl_primitive_desc_iterator_t | iterator | ) |
Fetches the current primitive descriptor from a primitive descriptor iterator.
iterator | A primitive descriptor iterator. |
dnnl_status_t DNNL_API dnnl_primitive_desc_iterator_destroy | ( | dnnl_primitive_desc_iterator_t | iterator | ) |
Destroys a primitive descriptor iterator.
iterator | Primitive descriptor iterator to destroy. |
dnnl_status_t DNNL_API dnnl_primitive_desc_create | ( | dnnl_primitive_desc_t * | primitive_desc, |
const_dnnl_op_desc_t | op_desc, | ||
const_dnnl_primitive_attr_t | attr, | ||
dnnl_engine_t | engine, | ||
const_dnnl_primitive_desc_t | hint_forward_primitive_desc | ||
) |
Creates a primitive descriptor.
This function is equivalent to a sequence of dnnl_primitive_desc_iterator_create() and dnnl_primitive_desc_iterator_fetch(). In other words, the library will pick the first suitable implementation.
primitive_desc | Output primitive descriptor. |
op_desc | Operation descriptor. |
attr | Primitive attributes (can be NULL). |
engine | Engine to use. |
hint_forward_primitive_desc | For backward propagation: primitive descriptor for a respective forward propagation primitive. Pass NULL for forward propagation. |
dnnl_status_t DNNL_API dnnl_primitive_desc_clone | ( | dnnl_primitive_desc_t * | primitive_desc, |
const_dnnl_primitive_desc_t | existing_primitive_desc | ||
) |
Clones a primitive descriptor.
The resulting primitive descriptor must be destroyed separately.
primitive_desc | Output primitive descriptor. |
existing_primitive_desc | Primitive descriptor to clone. |
dnnl_status_t DNNL_API dnnl_primitive_desc_get_attr | ( | const_dnnl_primitive_desc_t | primitive_desc, |
const_dnnl_primitive_attr_t * | attr | ||
) |
Returns a constant reference to the attributes of a primitive descriptor.
attr
.attr
is the same as that of a primitive_desc
, so it is an error to use the attr
once the primitive_desc
has been destroyed.primitive_desc | Primitive descriptor. |
attr | Ouput primitive attributes. |
dnnl_status_t DNNL_API dnnl_primitive_desc_destroy | ( | dnnl_primitive_desc_t | primitive_desc | ) |
Destroys a primitive descriptor.
primitive_desc | Primitive descriptor to destroy. |
dnnl_status_t DNNL_API dnnl_primitive_desc_query | ( | const_dnnl_primitive_desc_t | primitive_desc, |
dnnl_query_t | what, | ||
int | index, | ||
void * | result | ||
) |
Queries a primitive descriptor for various pieces of information.
The most common use case is to query a primitive descriptor, created with source, weights, and destination memory descriptors with format tags set to dnnl_format_tag_any, for the corresponding memory descriptors (in this case the what
is set to dnnl_query_src_md, dnnl_query_weights_md, and dnnl_query_dst_md respectively) so that it is possible to create memory objects and reorder primitives if necessary.
Another typical use case is to query a primitive descriptor for workspace memory descriptor (with what
set to dnnl_query_workspace_md). If this query returns dnnl_not_required status, then workspace memory is not required.
A few other use cases:
primitive_desc | Primitive descriptor. |
what | Parameter to query. |
index | Index of the parameter to query for. |
result | Output result. The type depends on the query. For example, it must be a dnnl_memory_desc_t* if querying for a memory descriptor. |
const dnnl_memory_desc_t DNNL_API* dnnl_primitive_desc_query_md | ( | const_dnnl_primitive_desc_t | primitive_desc, |
dnnl_query_t | what, | ||
int | index | ||
) |
Queries primitive descriptor for a memory descriptor.
primitive_desc | Primitive descriptor. |
what | Kind of memory descriptor parameter to query for. |
index | Index of the parameter to query. |
int DNNL_API dnnl_primitive_desc_query_s32 | ( | const_dnnl_primitive_desc_t | primitive_desc, |
dnnl_query_t | what, | ||
int | index | ||
) |
Queries primitive descriptor for a signed 32bit int.
primitive_desc | Primitive descriptor. |
what | Kind of the value to query for. |
index | Index of the parameter to query. |
dnnl_status_t DNNL_API dnnl_primitive_create | ( | dnnl_primitive_t * | primitive, |
const_dnnl_primitive_desc_t | primitive_desc | ||
) |
Creates a primitive.
primitive | Output primitive. |
primitive_desc | Primitive descriptor used to create the primitive. |
dnnl_status_t DNNL_API dnnl_primitive_execute | ( | const_dnnl_primitive_t | primitive, |
dnnl_stream_t | stream, | ||
int | nargs, | ||
const dnnl_exec_arg_t * | args | ||
) |
Executes a primitive.
primitive | Primitive to execute. |
stream | Stream to use. |
nargs | Number of arguments. |
args | Array of arguments. Each argument is an <index, dnnl_memory_t> pair. The index is one of the DNNL_ARG_* values such as DNNL_ARG_SRC . Unless runtime shapes are used (see DNNL_RUNTIME_DIM_VAL), the memory object must have the same memory descriptor as that returned by dnnl_primitive_desc_query_md(dnnl_query_exec_arg_md, index). |
dnnl_status_t DNNL_API dnnl_primitive_get_primitive_desc | ( | const_dnnl_primitive_t | primitive, |
const_dnnl_primitive_desc_t * | primitive_desc | ||
) |
Retrieves a constant reference to the primitive descriptor of a given primitive.
const
qualifier of the returned object prevents such attempts.primitive | Primitive to query for the primitive descriptor. |
primitive_desc | Output primitive descriptor. |
dnnl_status_t DNNL_API dnnl_primitive_destroy | ( | dnnl_primitive_t | primitive | ) |
Destroys a primitive.
primitive | The primitive to destroy. |
|
inline |
Converts primitive kind enum value from C++ API to C API type.
kind | C++ API primitive kind enum value. |
|
inline |
Converts normalization flags enum value from C++ API to C API type.
flags | C++ API normalization flags enum value. |
|
inline |
Converts query enum value from C++ API to C API type.
query | C++ API query enum value. |
|
inline |
Returns the C API primitive descriptor of the underlying C API primitive.
|
inline |
Returns the kind of the primitive.