Package org.apache.sysds.runtime.matrix.data

## Class LibMatrixCuDNNPoolingDescriptors

- java.lang.Object
- - org.apache.sysds.runtime.matrix.data.LibMatrixCuDNNPoolingDescriptors

All Implemented Interfaces:
  `AutoCloseable`

    public class LibMatrixCuDNNPoolingDescriptors
    extends Object
    implements AutoCloseable

This class is a wrapper that contain necessary data structures to invoke a cudnn convolution* functions (such as cudnnConvolutionForward, etc) It implements autocloseable to simplify the LibMatrixCuDNN code and also avoids potential memory leaks.

### Field Summary

Fields
`jcuda.jcudnn.cudnnTensorDescriptor` `dxDesc`
`jcuda.jcudnn.cudnnTensorDescriptor` `dyDesc`
`jcuda.jcudnn.cudnnPoolingDescriptor` `poolingDesc`
`jcuda.jcudnn.cudnnTensorDescriptor` `xDesc`
`jcuda.jcudnn.cudnnTensorDescriptor` `yDesc`

### Constructor Summary

Constructors
`LibMatrixCuDNNPoolingDescriptors()`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`void` `close()`
`static LibMatrixCuDNNPoolingDescriptors` `cudnnPoolingBackwardDescriptors​(GPUContext gCtx, String instName, int N, int C, int H, int W, int K, int R, int S, int pad_h, int pad_w, int stride_h, int stride_w, int P, int Q, LibMatrixDNN.PoolingType poolingType)` Get descriptors for maxpooling backward operation
`static LibMatrixCuDNNPoolingDescriptors` `cudnnPoolingDescriptors​(GPUContext gCtx, String instName, int N, int C, int H, int W, int K, int R, int S, int pad_h, int pad_w, int stride_h, int stride_w, int P, int Q, LibMatrixDNN.PoolingType poolingType)` Get descriptors for maxpooling operation

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### xDesc

    public jcuda.jcudnn.cudnnTensorDescriptor xDesc

#### yDesc

    public jcuda.jcudnn.cudnnTensorDescriptor yDesc

#### dxDesc

    public jcuda.jcudnn.cudnnTensorDescriptor dxDesc

#### dyDesc

    public jcuda.jcudnn.cudnnTensorDescriptor dyDesc

#### poolingDesc

    public jcuda.jcudnn.cudnnPoolingDescriptor poolingDesc

### Constructor Detail

#### LibMatrixCuDNNPoolingDescriptors

    public LibMatrixCuDNNPoolingDescriptors()

### Method Detail

#### close

    public void close()

Specified by:
  `close` in interface `AutoCloseable`

#### cudnnPoolingBackwardDescriptors

    public static LibMatrixCuDNNPoolingDescriptors cudnnPoolingBackwardDescriptors​(GPUContext gCtx,
                                                                                   String instName,
                                                                                   int N,
                                                                                   int C,
                                                                                   int H,
                                                                                   int W,
                                                                                   int K,
                                                                                   int R,
                                                                                   int S,
                                                                                   int pad_h,
                                                                                   int pad_w,
                                                                                   int stride_h,
                                                                                   int stride_w,
                                                                                   int P,
                                                                                   int Q,
                                                                                   LibMatrixDNN.PoolingType poolingType)

Get descriptors for maxpooling backward operation

Parameters:
  `gCtx` - gpu context
  `instName` - instruction name
  `N` - batch size
  `C` - number of channels
  `H` - height of image
  `W` - width of image
  `K` - number of filters
  `R` - height of filter
  `S` - width of filter
  `pad_h` - vertical padding
  `pad_w` - horizontal padding
  `stride_h` - horizontal stride
  `stride_w` - vertical stride
  `P` - (H - R + 1 + 2*pad_h)/stride_h
  `Q` - (W - S + 1 + 2*pad_w)/stride_w
  `poolingType` - type of pooling
Returns:
  decriptor wrapper

#### cudnnPoolingDescriptors

    public static LibMatrixCuDNNPoolingDescriptors cudnnPoolingDescriptors​(GPUContext gCtx,
                                                                           String instName,
                                                                           int N,
                                                                           int C,
                                                                           int H,
                                                                           int W,
                                                                           int K,
                                                                           int R,
                                                                           int S,
                                                                           int pad_h,
                                                                           int pad_w,
                                                                           int stride_h,
                                                                           int stride_w,
                                                                           int P,
                                                                           int Q,
                                                                           LibMatrixDNN.PoolingType poolingType)

Get descriptors for maxpooling operation

Parameters:
  `gCtx` - gpu context
  `instName` - instruction name
  `N` - batch size
  `C` - number of channels
  `H` - height of image
  `W` - width of image
  `K` - number of filters
  `R` - height of filter
  `S` - width of filter
  `pad_h` - vertical padding
  `pad_w` - horizontal padding
  `stride_h` - horizontal stride
  `stride_w` - vertical stride
  `P` - (H - R + 1 + 2*pad_h)/stride_h
  `Q` - (W - S + 1 + 2*pad_w)/stride_w
  `poolingType` - type of pooling
Returns:
  decriptor wrapper