oneAPI Deep Neural Network Library (oneDNN)
Performance library for Deep Learning
1.96.0

A primitive to perform max or average pooling. More...

Classes

struct  dnnl::pooling_forward
 Pooling forward propagation primitive. More...
 
struct  dnnl::pooling_backward
 Pooling backward propagation primitive. More...
 
struct  dnnl::pooling_v2_forward
 Pooling v2 (dilated pooling) forward propagation primitive. More...
 
struct  dnnl::pooling_v2_backward
 Pooling v2 (dilated pooling) backward propagation primitive. More...
 
struct  dnnl_pooling_desc_t
 A descriptor of a pooling operation. More...
 

Functions

dnnl_status_t DNNL_API dnnl_pooling_forward_desc_init (dnnl_pooling_desc_t *pool_desc, dnnl_prop_kind_t prop_kind, dnnl_alg_kind_t alg_kind, const dnnl_memory_desc_t *src_desc, const dnnl_memory_desc_t *dst_desc, const dnnl_dims_t strides, const dnnl_dims_t kernel, const dnnl_dims_t padding_l, const dnnl_dims_t padding_r)
 Initializes a descriptor for pooling forward propagation primitive. More...
 
dnnl_status_t DNNL_API dnnl_pooling_backward_desc_init (dnnl_pooling_desc_t *pool_desc, dnnl_alg_kind_t alg_kind, const dnnl_memory_desc_t *diff_src_desc, const dnnl_memory_desc_t *diff_dst_desc, const dnnl_dims_t strides, const dnnl_dims_t kernel, const dnnl_dims_t padding_l, const dnnl_dims_t padding_r)
 Initializes a descriptor for pooling backward propagation primitive. More...
 
dnnl_status_t DNNL_API dnnl_pooling_v2_forward_desc_init (dnnl_pooling_v2_desc_t *pool_desc, dnnl_prop_kind_t prop_kind, dnnl_alg_kind_t alg_kind, const dnnl_memory_desc_t *src_desc, const dnnl_memory_desc_t *dst_desc, const dnnl_dims_t strides, const dnnl_dims_t kernel, const dnnl_dims_t dilation, const dnnl_dims_t padding_l, const dnnl_dims_t padding_r)
 Initializes a descriptor for pooling v2 (pooling with dilation support) forward propagation primitive. More...
 
dnnl_status_t DNNL_API dnnl_pooling_v2_backward_desc_init (dnnl_pooling_v2_desc_t *pool_desc, dnnl_alg_kind_t alg_kind, const dnnl_memory_desc_t *diff_src_desc, const dnnl_memory_desc_t *diff_dst_desc, const dnnl_dims_t strides, const dnnl_dims_t kernel, const dnnl_dims_t dilation, const dnnl_dims_t padding_l, const dnnl_dims_t padding_r)
 Initializes a descriptor for pooling v2 (pooling with dilation support) backward propagation primitive. More...
 

Detailed Description

A primitive to perform max or average pooling.

Pooling version 2 (dilated pooling).

See also
Pooling in developer guide

A primitive to perform max or average pooling.

See also
Pooling in developer guide

Function Documentation

◆ dnnl_pooling_forward_desc_init()

dnnl_status_t DNNL_API dnnl_pooling_forward_desc_init ( dnnl_pooling_desc_t pool_desc,
dnnl_prop_kind_t  prop_kind,
dnnl_alg_kind_t  alg_kind,
const dnnl_memory_desc_t src_desc,
const dnnl_memory_desc_t dst_desc,
const dnnl_dims_t  strides,
const dnnl_dims_t  kernel,
const dnnl_dims_t  padding_l,
const dnnl_dims_t  padding_r 
)

Initializes a descriptor for pooling forward propagation primitive.

Arrays strides, kernel, padding_l, and padding_r contain values for spatial dimensions only and hence must have the same number of elements as there are spatial dimensions. The order of values is the same as in the tensor: depth (for 3D tensors), height (for 3D and 2D tensors), and width.

Parameters
pool_descOutput descriptor for a pooling primitive.
prop_kindPropagation kind. Possible values are dnnl_forward_training and dnnl_forward_inference.
alg_kindPooling algorithm kind: either dnnl_pooling_max, dnnl_pooling_avg_include_padding, or dnnl_pooling_avg (same as dnnl_pooling_avg_exclude_padding).
src_descSource memory descriptor.
dst_descDestination memory descriptor.
stridesArray of strides for spatial dimension.
kernelArray of kernel spatial dimensions.
padding_lArray of padding values for low indices for each spatial dimension ([[front,] top,] left).
padding_rArray of padding values for high indices for each spatial dimension ([[back,] bottom,] right). Can be NULL in which case padding is considered to be symmetrical.
Returns
dnnl_success on success and a status describing the error otherwise.

◆ dnnl_pooling_backward_desc_init()

dnnl_status_t DNNL_API dnnl_pooling_backward_desc_init ( dnnl_pooling_desc_t pool_desc,
dnnl_alg_kind_t  alg_kind,
const dnnl_memory_desc_t diff_src_desc,
const dnnl_memory_desc_t diff_dst_desc,
const dnnl_dims_t  strides,
const dnnl_dims_t  kernel,
const dnnl_dims_t  padding_l,
const dnnl_dims_t  padding_r 
)

Initializes a descriptor for pooling backward propagation primitive.

Arrays strides, kernel, padding_l, and padding_r contain values for spatial dimensions only and hence must have the same number of elements as there are spatial dimensions. The order of values is the same as in the tensor: depth (for 3D tensors), height (for 3D and 2D tensors), and width.

Parameters
pool_descOutput descriptor for a pooling primitive.
alg_kindPooling algorithm kind: either dnnl_pooling_max, dnnl_pooling_avg_include_padding, or dnnl_pooling_avg (same as dnnl_pooling_avg_exclude_padding).
diff_src_descDiff source memory descriptor.
diff_dst_descDiff destination memory descriptor.
stridesArray of strides for spatial dimension.
kernelArray of kernel spatial dimensions.
padding_lArray of padding values for low indices for each spatial dimension ([[front,] top,] left).
padding_rArray of padding values for high indices for each spatial dimension ([[back,] bottom,] right). Can be NULL in which case padding is considered to be symmetrical.
Returns
dnnl_success on success and a status describing the error otherwise.

◆ dnnl_pooling_v2_forward_desc_init()

dnnl_status_t DNNL_API dnnl_pooling_v2_forward_desc_init ( dnnl_pooling_v2_desc_t pool_desc,
dnnl_prop_kind_t  prop_kind,
dnnl_alg_kind_t  alg_kind,
const dnnl_memory_desc_t src_desc,
const dnnl_memory_desc_t dst_desc,
const dnnl_dims_t  strides,
const dnnl_dims_t  kernel,
const dnnl_dims_t  dilation,
const dnnl_dims_t  padding_l,
const dnnl_dims_t  padding_r 
)

Initializes a descriptor for pooling v2 (pooling with dilation support) forward propagation primitive.

Arrays strides, kernel, dilation, padding_l and padding_r contain values for spatial dimensions only and hence must have the same number of elements as there are spatial dimensions. The order of values is the same as in the tensor: depth (for 3D tensors), height (for 3D and 2D tensors), and width.

Parameters
pool_descOutput descriptor for a pooling primitive.
prop_kindPropagation kind. Possible values are dnnl_forward_training and dnnl_forward_inference.
alg_kindPooling algorithm kind: either dnnl_pooling_max, dnnl_pooling_avg_include_padding, or dnnl_pooling_avg (same as dnnl_pooling_avg_exclude_padding).
src_descSource memory descriptor.
dst_descDestination memory descriptor.
stridesArray of strides for spatial dimension.
kernelArray of kernel spatial dimensions.
dilationArray of dilations for spatial dimension.
padding_lArray of padding values for low indices for each spatial dimension ([[front,] top,] left).
padding_rArray of padding values for high indices for each spatial dimension ([[back,] bottom,] right). Can be NULL in which case padding is considered to be symmetrical.
Returns
dnnl_success on success and a status describing the error otherwise.
Examples:
cnn_inference_f32.c, and cpu_cnn_training_f32.c.

◆ dnnl_pooling_v2_backward_desc_init()

dnnl_status_t DNNL_API dnnl_pooling_v2_backward_desc_init ( dnnl_pooling_v2_desc_t pool_desc,
dnnl_alg_kind_t  alg_kind,
const dnnl_memory_desc_t diff_src_desc,
const dnnl_memory_desc_t diff_dst_desc,
const dnnl_dims_t  strides,
const dnnl_dims_t  kernel,
const dnnl_dims_t  dilation,
const dnnl_dims_t  padding_l,
const dnnl_dims_t  padding_r 
)

Initializes a descriptor for pooling v2 (pooling with dilation support) backward propagation primitive.

Arrays strides, kernel, dilation, padding_l and padding_r contain values for spatial dimensions only and hence must have the same number of elements as there are spatial dimensions. The order of values is the same as in the tensor: depth (for 3D tensors), height (for 3D and 2D tensors), and width.

Parameters
pool_descOutput descriptor for a pooling primitive.
alg_kindPooling algorithm kind: either dnnl_pooling_max, dnnl_pooling_avg_include_padding, or dnnl_pooling_avg (same as dnnl_pooling_avg_exclude_padding).
diff_src_descDiff source memory descriptor.
diff_dst_descDiff destination memory descriptor.
stridesArray of strides for spatial dimension.
kernelArray of kernel spatial dimensions.
dilationArray of dilations for spatial dimension.
padding_lArray of padding values for low indices for each spatial dimension ([[front,] top,] left).
padding_rArray of padding values for high indices for each spatial dimension ([[back,] bottom,] right). Can be NULL in which case padding is considered to be symmetrical.
Returns
dnnl_success on success and a status describing the error otherwise.
Examples:
cpu_cnn_training_f32.c.