Library/ManagedCuda/CudaDNN/CudaDNNNativeMethods.cs
/// <summary>
/// This routine executes the recurrent neural network described by rnnDesc with inputs x, hx, cx, weights w 
/// and outputs y, hy, cy. workspace is required for intermediate storage. reserveSpace stores data required 
/// for training. The same reserveSpace data must be used for future calls to cudnnRNNBackwardData and 
/// cudnnRNNBackwardWeights if these execute on the same input data. 
/// </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="cxDesc">Handle to a previously initialized tensor descriptor describing the initial 
/// cell state for LSTM networks. 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="cx">Data pointer to GPU memory associated with the tensor descriptor cxDesc. If a NULL pointer is 
/// passed, the initial cell state of the network will be initialized to zero.</param>
/// <param name="wDesc">Handle to a previously initialized filter descriptor describing the weights for the RNN.</param>
/// <param name="w">Data pointer to GPU memory associated with the filter descriptor wDesc.</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 xDesc. 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="hyDesc">Handle to a previously initialized tensor descriptor describing the final 
/// 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="hy">Data pointer to GPU memory associated with the tensor descriptor hyDesc. If a 
/// NULL pointer is passed, the final hidden state of the network will not be saved.</param>
/// <param name="cyDesc">Handle to a previously initialized tensor descriptor describing the final cell state 
/// for LSTM networks. 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="cy">Data pointer to GPU memory associated with the tensor descriptor cyDesc. If a NULL pointer is 
/// passed, the final cell state of the network will be not be saved.</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="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 executes the recurrent neural network described by rnnDesc with inputs x, hx, cx, weights w
and outputs y, hy, cy. workspace is required for intermediate storage. reserveSpace stores data required
for training. The same reserveSpace data must be used for future calls to cudnnRNNBackwardData and
cudnnRNNBackwardWeights if these execute on the same input data.
This routine executes the recurrent neural network described by rnnDesc with inputs x hx cx weights w and outputs y hy cy . workspace is required for intermediate storage . reserveSpace stores data required for training . The same reserveSpace data must be used for future calls to cudnnRNNBackwardData and cudnnRNNBackwardWeights if these execute on the same input data .
[DllImport(CUDNN_API_DLL_NAME)]
        public static extern cudnnStatus cudnnRNNForwardTraining(cudnnHandle handle,
                                                   cudnnRNNDescriptor rnnDesc,
                                                   cudnnTensorDescriptor[] xDesc,
                                                   CUdeviceptr x,
                                                   cudnnTensorDescriptor hxDesc,
                                                   CUdeviceptr hx,
                                                   cudnnTensorDescriptor cxDesc,
                                                   CUdeviceptr cx,
                                                   cudnnFilterDescriptor wDesc,
                                                   CUdeviceptr w,
                                                   cudnnTensorDescriptor[] yDesc,
                                                   CUdeviceptr y,
                                                   cudnnTensorDescriptor hyDesc,
                                                   CUdeviceptr hy,
                                                   cudnnTensorDescriptor cyDesc,
                                                   CUdeviceptr cy,
                                                   CUdeviceptr workspace,
                                                   SizeT workSpaceSizeInBytes,
                                                   CUdeviceptr reserveSpace,
                                                   SizeT reserveSpaceSizeInBytes);
[ DllImport ( CUDNN_API_DLL_NAME ) ] public static extern cudnnStatus cudnnRNNForwardTraining ( cudnnHandle handle , cudnnRNNDescriptor rnnDesc , cudnnTensorDescriptor [ ] xDesc , CUdeviceptr x , cudnnTensorDescriptor hxDesc , CUdeviceptr hx , cudnnTensorDescriptor cxDesc , CUdeviceptr cx , cudnnFilterDescriptor wDesc , CUdeviceptr w , cudnnTensorDescriptor [ ] yDesc , CUdeviceptr y , cudnnTensorDescriptor hyDesc , CUdeviceptr hy , cudnnTensorDescriptor cyDesc , CUdeviceptr cy , CUdeviceptr workspace , SizeT workSpaceSizeInBytes , CUdeviceptr reserveSpace , SizeT reserveSpaceSizeInBytes ) ;
This routine executes the recurrent neural network described by rnnDesc with inputs x, hx, cx, weights w
and outputs y, hy, cy.
This routine executes the recurrent neural network described by rnnDesc with inputs x hx cx weights w and outputs y hy cy .
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 .
cxDesc
cudnnTensorDescriptor
Handle to a previously initialized tensor descriptor describing the initial
cell state for LSTM networks. 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 cell state for LSTM networks . 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 .
cx
CUdeviceptr
Data pointer to GPU memory associated with the tensor descriptor cxDesc. If a NULL pointer is
passed, the initial cell state of the network will be initialized to zero.
Data pointer to GPU memory associated with the tensor descriptor cxDesc . If a NULL pointer is passed the initial cell state of the network will be initialized to zero .
wDesc
cudnnFilterDescriptor
Handle to a previously initialized filter descriptor describing the weights for the RNN.
Handle to a previously initialized filter descriptor describing the weights for the RNN .
w
CUdeviceptr
Data pointer to GPU memory associated with the filter descriptor wDesc.
Data pointer to GPU memory associated with the filter descriptor wDesc .
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 xDesc. 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 xDesc . 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 .
hyDesc
cudnnTensorDescriptor
Handle to a previously initialized tensor descriptor describing the final
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 final 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 .
hy
CUdeviceptr
Data pointer to GPU memory associated with the tensor descriptor hyDesc. If a
NULL pointer is passed, the final hidden state of the network will not be saved.
Data pointer to GPU memory associated with the tensor descriptor hyDesc . If a NULL pointer is passed the final hidden state of the network will not be saved .
cyDesc
cudnnTensorDescriptor
Handle to a previously initialized tensor descriptor describing the final cell state
for LSTM networks. 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 final cell state for LSTM networks . 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 .
cy
CUdeviceptr
Data pointer to GPU memory associated with the tensor descriptor cyDesc. If a NULL pointer is
passed, the final cell state of the network will be not be saved.
Data pointer to GPU memory associated with the tensor descriptor cyDesc . If a NULL pointer is passed the final cell state of the network will be not be saved .
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 .
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 .