Library/ManagedCuda/CudaDNN/CudaDNNNativeMethods.cs
/// <summary>
/// This routine accumulates weight gradients dw from the recurrent neural network described 
/// by rnnDesc with inputs x, hx, and outputs y. The mode of operation in this case is additive, 
/// the weight gradients calculated will be added to those already existing in dw. workspace 
/// is required for intermediate storage. The data in reserveSpace must have previously been 
/// generated by cudnnRNNBackwardData.
/// </summary>
/// <param name="handle">Handle to a previously created cuDNN context.</param>
/// <param name="rnnDesc">A previously initialized RNN descriptor.</param>
/// <param name="xDesc">An array of tensor descriptors describing the input to each recurrent iteration. 
/// Each tensor descriptor must have the same first dimension. The second dimension of the tensors may 
/// decrease from element n to element n+1 but may not increase. The tensor must be fully packed.</param>
/// <param name="x">Data pointer to GPU memory associated with the tensor descriptors in the array xDesc.</param>
/// <param name="hxDesc">Handle to a previously initialized tensor descriptor describing the initial hidden 
/// state of the RNN. The first dimension of the tensor must match the hiddenSize argument passed to the 
/// cudnnSetRNNDescriptor call used to initialize rnnDesc. The second dimension must match the second dimension
/// of the first tensor described in xDesc. The third dimension must match the numLayers argument passed to 
/// the cudnnSetRNNDescriptor call used to initialize rnnDesc. The tensor must be fully packed. </param>
/// <param name="hx">Data pointer to GPU memory associated with the tensor descriptor hxDesc. If 
/// a NULL pointer is passed, the initial hidden state of the network will be initialized to zero.</param>
/// <param name="yDesc">An array of tensor descriptors describing the output from each 
/// recurrent iteration. The first dimension of the tensor depends on the direction 
/// argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc:
/// * If direction is CUDNN_UNIDIRECTIONAL the first dimension should match the hiddenSize 
/// argument passed to cudnnSetRNNDescriptor.
/// * If direction is CUDNN_BIDIRECTIONAL the first dimension should match double the hiddenSize 
/// argument passed to cudnnSetRNNDescriptor.
/// The second dimension of the tensor n must match the second dimension of the tensor n in dyDesc. 
/// The tensor must be fully packed.</param>
/// <param name="y">Data pointer to GPU memory associated with the output tensor descriptor yDesc.</param>
/// <param name="workspace">Data pointer to GPU memory to be used as a workspace for this call.</param>
/// <param name="workSpaceSizeInBytes">Specifies the size in bytes of the provided workspace.</param>
/// <param name="dwDesc">Handle to a previously initialized filter descriptor describing the gradients of the weights for the RNN.</param>
/// <param name="dw">Data pointer to GPU memory associated with the filter descriptor dwDesc.</param>
/// <param name="reserveSpace">Data pointer to GPU memory to be used as a reserve space for this call.</param>
/// <param name="reserveSpaceSizeInBytes">Specifies the size in bytes of the provided reserveSpace.</param>
This routine accumulates weight gradients dw from the recurrent neural network described
by rnnDesc with inputs x, hx, and outputs y. The mode of operation in this case is additive,
the weight gradients calculated will be added to those already existing in dw. workspace
is required for intermediate storage. The data in reserveSpace must have previously been
generated by cudnnRNNBackwardData.
This routine accumulates weight gradients dw from the recurrent neural network described by rnnDesc with inputs x hx and outputs y . The mode of operation in this case is additive the weight gradients calculated will be added to those already existing in dw . workspace is required for intermediate storage . The data in reserveSpace must have previously been generated by cudnnRNNBackwardData .
[DllImport(CUDNN_API_DLL_NAME)]
        public static extern cudnnStatus cudnnRNNBackwardWeights(cudnnHandle handle,
                                                   cudnnRNNDescriptor rnnDesc,
                                                   cudnnTensorDescriptor[] xDesc,
                                                   CUdeviceptr x,
                                                   cudnnTensorDescriptor hxDesc,
                                                   CUdeviceptr hx,
                                                   cudnnTensorDescriptor[] yDesc,
                                                   CUdeviceptr y,
                                                   CUdeviceptr workspace,
                                                   SizeT workSpaceSizeInBytes, 
                                                   cudnnFilterDescriptor dwDesc,
                                                   CUdeviceptr dw,
                                                   CUdeviceptr reserveSpace,
                                                   SizeT reserveSpaceSizeInBytes );
[ DllImport ( CUDNN_API_DLL_NAME ) ] public static extern cudnnStatus cudnnRNNBackwardWeights ( cudnnHandle handle , cudnnRNNDescriptor rnnDesc , cudnnTensorDescriptor [ ] xDesc , CUdeviceptr x , cudnnTensorDescriptor hxDesc , CUdeviceptr hx , cudnnTensorDescriptor [ ] yDesc , CUdeviceptr y , CUdeviceptr workspace , SizeT workSpaceSizeInBytes , cudnnFilterDescriptor dwDesc , CUdeviceptr dw , CUdeviceptr reserveSpace , SizeT reserveSpaceSizeInBytes ) ;
This routine accumulates weight gradients dw from the recurrent neural network described
by rnnDesc with inputs x, hx, and outputs y.
This routine accumulates weight gradients dw from the recurrent neural network described by rnnDesc with inputs x hx and outputs y .
handle
cudnnHandle
Handle to a previously created cuDNN context.
Handle to a previously created cuDNN context .
rnnDesc
cudnnRNNDescriptor
A previously initialized RNN descriptor.
A previously initialized RNN descriptor .
xDesc
cudnnTensorDescriptor[]
An array of tensor descriptors describing the input to each recurrent iteration.
Each tensor descriptor must have the same first dimension. The second dimension of the tensors may
decrease from element n to element n+1 but may not increase. The tensor must be fully packed.
An array of tensor descriptors describing the input to each recurrent iteration . Each tensor descriptor must have the same first dimension . The second dimension of the tensors may decrease from element n to element n + 1 but may not increase . The tensor must be fully packed .
x
CUdeviceptr
Data pointer to GPU memory associated with the tensor descriptors in the array xDesc.
Data pointer to GPU memory associated with the tensor descriptors in the array xDesc .
hxDesc
cudnnTensorDescriptor
Handle to a previously initialized tensor descriptor describing the initial hidden
state of the RNN. The first dimension of the tensor must match the hiddenSize argument passed to the
cudnnSetRNNDescriptor call used to initialize rnnDesc. The second dimension must match the second dimension
of the first tensor described in xDesc. The third dimension must match the numLayers argument passed to
the cudnnSetRNNDescriptor call used to initialize rnnDesc. The tensor must be fully packed.
Handle to a previously initialized tensor descriptor describing the initial hidden state of the RNN . The first dimension of the tensor must match the hiddenSize argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc . The second dimension must match the second dimension of the first tensor described in xDesc . The third dimension must match the numLayers argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc . The tensor must be fully packed .
hx
CUdeviceptr
Data pointer to GPU memory associated with the tensor descriptor hxDesc. If
a NULL pointer is passed, the initial hidden state of the network will be initialized to zero.
Data pointer to GPU memory associated with the tensor descriptor hxDesc . If a NULL pointer is passed the initial hidden state of the network will be initialized to zero .
yDesc
cudnnTensorDescriptor[]
An array of tensor descriptors describing the output from each
recurrent iteration. The first dimension of the tensor depends on the direction
argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc:
If direction is CUDNN_UNIDIRECTIONAL the first dimension should match the hiddenSize
argument passed to cudnnSetRNNDescriptor.
If direction is CUDNN_BIDIRECTIONAL the first dimension should match double the hiddenSize
argument passed to cudnnSetRNNDescriptor.
The second dimension of the tensor n must match the second dimension of the tensor n in dyDesc.
The tensor must be fully packed.
An array of tensor descriptors describing the output from each recurrent iteration . The first dimension of the tensor depends on the direction argument passed to the cudnnSetRNNDescriptor call used to initialize rnnDesc : If direction is CUDNN_UNIDIRECTIONAL the first dimension should match the hiddenSize argument passed to cudnnSetRNNDescriptor . If direction is CUDNN_BIDIRECTIONAL the first dimension should match double the hiddenSize argument passed to cudnnSetRNNDescriptor . The second dimension of the tensor n must match the second dimension of the tensor n in dyDesc . The tensor must be fully packed .
y
CUdeviceptr
Data pointer to GPU memory associated with the output tensor descriptor yDesc.
Data pointer to GPU memory associated with the output tensor descriptor yDesc .
workspace
CUdeviceptr
Data pointer to GPU memory to be used as a workspace for this call.
Data pointer to GPU memory to be used as a workspace for this call .
workSpaceSizeInBytes
SizeT
Specifies the size in bytes of the provided workspace.
Specifies the size in bytes of the provided workspace .
dwDesc
cudnnFilterDescriptor
Handle to a previously initialized filter descriptor describing the gradients of the weights for the RNN.
Handle to a previously initialized filter descriptor describing the gradients of the weights for the RNN .
dw
CUdeviceptr
Data pointer to GPU memory associated with the filter descriptor dwDesc.
Data pointer to GPU memory associated with the filter descriptor dwDesc .
reserveSpace
CUdeviceptr
Data pointer to GPU memory to be used as a reserve space for this call.
Data pointer to GPU memory to be used as a reserve space for this call .
reserveSpaceSizeInBytes
SizeT
Specifies the size in bytes of the provided reserveSpace.
Specifies the size in bytes of the provided reserveSpace .