C# Class ManagedCuda.CudaDNN.ConvolutionDescriptor

An opaque structure holding the description of a convolution operation.
Inheritance: IDisposable
Datei anzeigen Open project: kunzmi/managedCuda Class Usage Examples

Public Methods

Method Description
ConvolutionDescriptor ( ) : System

Dispose ( ) : void

Dispose

GetConvolution2dDescriptor ( int &pad_h, int &pad_w, int &u, int &v, int &upscalex, int &upscaley, cudnnConvolutionMode &mode, cudnnDataType &dataType ) : void

This function queries a previously initialized 2D convolution descriptor object.

GetConvolution2dForwardOutputDim ( TensorDescriptor inputTensorDesc, FilterDescriptor filterDesc, int &n, int &c, int &h, int &w ) : void

This function returns the dimensions of the resulting 4D tensor of a 2D convolution, given the convolution descriptor, the input tensor descriptor and the filter descriptor This function can help to setup the output tensor and allocate the proper amount of memory prior to launch the actual convolution. Each dimension h and w of the output images is computed as followed: outputDim = 1 + (inputDim + 2*pad - filterDim)/convolutionStride;

GetConvolutionNdDescriptor ( int arrayLengthRequested, int &arrayLength, int padA, int strideA, int upscaleA, cudnnConvolutionMode &mode, cudnnDataType &dataType ) : void

This function queries a previously initialized convolution descriptor object.

GetConvolutionNdForwardOutputDim ( TensorDescriptor inputTensorDesc, FilterDescriptor filterDesc, int nbDims, int tensorOuputDimA ) : void

This function returns the dimensions of the resulting n-D tensor of a nbDims-2-D convolution, given the convolution descriptor, the input tensor descriptor and the filter descriptor This function can help to setup the output tensor and allocate the proper amount of memory prior to launch the actual convolution. Each dimension of the (nbDims-2)-D images of the output tensor is computed as followed: outputDim = 1 + (inputDim + 2*pad - filterDim)/convolutionStride;

SetConvolution2dDescriptor ( int pad_h, int pad_w, int u, int v, int upscalex, int upscaley, cudnnConvolutionMode mode, cudnnDataType dataType ) : void

This function initializes a previously created convolution descriptor object into a 2D correlation. This function assumes that the tensor and filter descriptors corresponds to the formard convolution path and checks if their settings are valid. That same convolution descriptor can be reused in the backward path provided it corresponds to the same layer.

SetConvolutionNdDescriptor ( int arrayLength, int padA, int filterStrideA, int upscaleA, cudnnConvolutionMode mode, cudnnDataType dataType ) : void

This function initializes a previously created generic convolution descriptor object into a n-D correlation. That same convolution descriptor can be reused in the backward path provided it corresponds to the same layer. The convolution computation will done in the specified dataType, which can be potentially different from the input/output tensors.

Protected Methods

Method Description
Dispose ( bool fDisposing ) : void

For IDisposable

Method Details

ConvolutionDescriptor() public method

public ConvolutionDescriptor ( ) : System
return System

Dispose() public method

Dispose
public Dispose ( ) : void
return void

Dispose() protected method

For IDisposable
protected Dispose ( bool fDisposing ) : void
fDisposing bool
return void

GetConvolution2dDescriptor() public method

This function queries a previously initialized 2D convolution descriptor object.
public GetConvolution2dDescriptor ( int &pad_h, int &pad_w, int &u, int &v, int &upscalex, int &upscaley, cudnnConvolutionMode &mode, cudnnDataType &dataType ) : void
pad_h int zero-padding height: number of rows of zeros implicitly concatenated /// onto the top and onto the bottom of input images.
pad_w int zero-padding width: number of columns of zeros implicitly concatenated /// onto the left and onto the right of input images.
u int Vertical filter stride.
v int Horizontal filter stride.
upscalex int Upscale the input in x-direction.
upscaley int Upscale the input in y-direction.
mode cudnnConvolutionMode convolution mode.
dataType cudnnDataType Selects the datatype in which the computation will be done.
return void

GetConvolution2dForwardOutputDim() public method

This function returns the dimensions of the resulting 4D tensor of a 2D convolution, given the convolution descriptor, the input tensor descriptor and the filter descriptor This function can help to setup the output tensor and allocate the proper amount of memory prior to launch the actual convolution. Each dimension h and w of the output images is computed as followed: outputDim = 1 + (inputDim + 2*pad - filterDim)/convolutionStride;
public GetConvolution2dForwardOutputDim ( TensorDescriptor inputTensorDesc, FilterDescriptor filterDesc, int &n, int &c, int &h, int &w ) : void
inputTensorDesc TensorDescriptor Handle to a previously initialized tensor descriptor.
filterDesc FilterDescriptor Handle to a previously initialized filter descriptor.
n int Number of output images.
c int Number of output feature maps per image.
h int Height of each output feature map.
w int Width of each output feature map.
return void

GetConvolutionNdDescriptor() public method

This function queries a previously initialized convolution descriptor object.
public GetConvolutionNdDescriptor ( int arrayLengthRequested, int &arrayLength, int padA, int strideA, int upscaleA, cudnnConvolutionMode &mode, cudnnDataType &dataType ) : void
arrayLengthRequested int Dimension of the expected convolution descriptor. It is also the /// minimum size of the arrays padA, filterStrideA and upsacleA in /// order to be able to hold the results
arrayLength int actual dimension of the convolution descriptor.
padA int Array of dimension of at least arrayLengthRequested that will be /// filled with the padding parameters from the provided convolution /// descriptor.
strideA int Array of dimension of at least arrayLengthRequested that will be /// filled with the filter stride from the provided convolution descriptor.
upscaleA int Array of dimension at least arrayLengthRequested that will be filled /// with the upscaling parameters from the provided convolution descriptor.
mode cudnnConvolutionMode convolution mode of the provided descriptor.
dataType cudnnDataType datatype of the provided descriptor.
return void

GetConvolutionNdForwardOutputDim() public method

This function returns the dimensions of the resulting n-D tensor of a nbDims-2-D convolution, given the convolution descriptor, the input tensor descriptor and the filter descriptor This function can help to setup the output tensor and allocate the proper amount of memory prior to launch the actual convolution. Each dimension of the (nbDims-2)-D images of the output tensor is computed as followed: outputDim = 1 + (inputDim + 2*pad - filterDim)/convolutionStride;
public GetConvolutionNdForwardOutputDim ( TensorDescriptor inputTensorDesc, FilterDescriptor filterDesc, int nbDims, int tensorOuputDimA ) : void
inputTensorDesc TensorDescriptor Handle to a previously initialized tensor descriptor.
filterDesc FilterDescriptor Handle to a previously initialized filter descriptor.
nbDims int Dimension of the output tensor
tensorOuputDimA int Array of dimensions nbDims that contains on exit of this routine the sizes /// of the output tensor
return void

SetConvolution2dDescriptor() public method

This function initializes a previously created convolution descriptor object into a 2D correlation. This function assumes that the tensor and filter descriptors corresponds to the formard convolution path and checks if their settings are valid. That same convolution descriptor can be reused in the backward path provided it corresponds to the same layer.
public SetConvolution2dDescriptor ( int pad_h, int pad_w, int u, int v, int upscalex, int upscaley, cudnnConvolutionMode mode, cudnnDataType dataType ) : void
pad_h int zero-padding height: number of rows of zeros implicitly concatenated /// onto the top and onto the bottom of input images.
pad_w int zero-padding width: number of columns of zeros implicitly concatenated /// onto the left and onto the right of input images.
u int Vertical filter stride.
v int Horizontal filter stride.
upscalex int Upscale the input in x-direction.
upscaley int Upscale the input in y-direction.
mode cudnnConvolutionMode Selects between CUDNN_CONVOLUTION and CUDNN_CROSS_CORRELATION.
dataType cudnnDataType Selects the datatype in which the computation will be done.
return void

SetConvolutionNdDescriptor() public method

This function initializes a previously created generic convolution descriptor object into a n-D correlation. That same convolution descriptor can be reused in the backward path provided it corresponds to the same layer. The convolution computation will done in the specified dataType, which can be potentially different from the input/output tensors.
public SetConvolutionNdDescriptor ( int arrayLength, int padA, int filterStrideA, int upscaleA, cudnnConvolutionMode mode, cudnnDataType dataType ) : void
arrayLength int Dimension of the convolution.
padA int Array of dimension arrayLength containing the zero-padding size /// for each dimension. For every dimension, the padding represents the /// number of extra zeros implicitly concatenated at the start and at the /// end of every element of that dimension.
filterStrideA int Array of dimension arrayLength containing the filter stride for each /// dimension. For every dimension, the fitler stride represents the number /// of elements to slide to reach the next start of the filtering window of /// the next point.
upscaleA int Array of dimension arrayLength containing the upscale factor for each dimension.
mode cudnnConvolutionMode Selects between CUDNN_CONVOLUTION and CUDNN_CROSS_CORRELATION.
dataType cudnnDataType Selects the datatype in which the computation will be done.
return void