Library/ManagedCuda/CudaDNN/CudaDNNContext.cs
/// <summary>
/// This function computes the convolution gradient with respect to the output tensor using
/// the specified algo, returning results in gradDesc. Scaling factors alpha and beta can
/// be used to scale the input tensor and the output tensor respectively.
/// </summary>
/// <param name="alpha">Pointer to scaling factors (in host memory) used to blend the computation
/// result with prior value in the output layer as follows: dstValue =
/// alpha[0]*result + beta[0]*priorDstValue. Please refer to this section for
/// additional details.</param>
/// <param name="wDesc">Handle to a previously initialized filter descriptor.</param>
/// <param name="w">Data pointer to GPU memory associated with the filter descriptor filterDesc.</param>
/// <param name="dyDesc">Handle to the previously initialized input differential tensor descriptor.</param>
/// <param name="dy">Data pointer to GPU memory associated with the input differential tensor descriptor diffDesc.</param>
/// <param name="convDesc">Previously initialized convolution descriptor.</param>
/// <param name="algo">Enumerant that specifies which backward data convolution algorithm shoud be used to compute the results</param>
/// <param name="workSpace">Data pointer to GPU memory to a workspace needed to able to execute
/// the specified algorithm. If no workspace is needed for a particular
/// algorithm, that pointer can be nil</param>
/// <param name="beta">Pointer to scaling factors (in host memory) used to blend the computation
/// result with prior value in the output layer as follows: dstValue =
/// alpha[0]*result + beta[0]*priorDstValue. Please refer to this section for
/// additional details.</param>
/// <param name="dxDesc">Handle to the previously initialized output tensor descriptor.</param>
/// <param name="dx">Data pointer to GPU memory associated with the output tensor descriptor
/// gradDesc that carries the result.</param>
This function computes the convolution gradient with respect to the output tensor using
the specified algo, returning results in gradDesc. Scaling factors alpha and beta can
be used to scale the input tensor and the output tensor respectively.
This function computes the convolution gradient with respect to the output tensor using the specified algo returning results in gradDesc . Scaling factors alpha and beta can be used to scale the input tensor and the output tensor respectively .
public void ConvolutionBackwardData(double alpha,
                                            FilterDescriptor wDesc,
                                            CudaDeviceVariable<double> w,
                                            TensorDescriptor dyDesc,
                                            CudaDeviceVariable<double> dy,
                                            ConvolutionDescriptor convDesc,
                                            cudnnConvolutionBwdDataAlgo algo,
                                            CudaDeviceVariable<byte> workSpace,
                                            double beta,
                                            TensorDescriptor dxDesc,
                                            CudaDeviceVariable<double> dx
                                        )
        {
            res = CudaDNNNativeMethods.cudnnConvolutionBackwardData(_handle, ref alpha, wDesc.Desc, w.DevicePointer, dyDesc.Desc, dy.DevicePointer, convDesc.Desc, algo, workSpace.DevicePointer, workSpace.SizeInBytes, ref beta, dxDesc.Desc, dx.DevicePointer);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnConvolutionBackwardData", res));
            if (res != cudnnStatus.Success) throw new CudaDNNException(res);
        }
public void ConvolutionBackwardData ( double alpha , FilterDescriptor wDesc , CudaDeviceVariable < double > w , TensorDescriptor dyDesc , CudaDeviceVariable < double > dy , ConvolutionDescriptor convDesc , cudnnConvolutionBwdDataAlgo algo , CudaDeviceVariable < byte > workSpace , double beta , TensorDescriptor dxDesc , CudaDeviceVariable < double > dx ) { res = CudaDNNNativeMethods . cudnnConvolutionBackwardData ( _handle , ref alpha , wDesc . Desc , w . DevicePointer , dyDesc . Desc , dy . DevicePointer , convDesc . Desc , algo , workSpace . DevicePointer , workSpace . SizeInBytes , ref beta , dxDesc . Desc , dx . DevicePointer ) ; Debug . WriteLine ( String . Format ( " " , DateTime . Now , " " , res ) ) ; if ( res != cudnnStatus . Success ) throw new CudaDNNException ( res ) ; }
This function computes the convolution gradient with respect to the output tensor using
the specified algo, returning results in gradDesc.
This function computes the convolution gradient with respect to the output tensor using the specified algo returning results in gradDesc .
alpha
double
Pointer to scaling factors (in host memory) used to blend the computation
result with prior value in the output layer as follows: dstValue
alpha[0]*result + beta[0]*priorDstValue. Please refer to this section for
additional details.
Pointer to scaling factors ( in host memory ) used to blend the computation result with prior value in the output layer as follows : dstValue alpha [ 0 ] * result + beta [ 0 ] * priorDstValue . Please refer to this section for additional details .
wDesc
FilterDescriptor
Handle to a previously initialized filter descriptor.
Handle to a previously initialized filter descriptor .
w
CudaDeviceVariable<double>
Data pointer to GPU memory associated with the filter descriptor filterDesc.
Data pointer to GPU memory associated with the filter descriptor filterDesc .
dyDesc
TensorDescriptor
Handle to the previously initialized input differential tensor descriptor.
Handle to the previously initialized input differential tensor descriptor .
dy
CudaDeviceVariable<double>
Data pointer to GPU memory associated with the input differential tensor descriptor diffDesc.
Data pointer to GPU memory associated with the input differential tensor descriptor diffDesc .
convDesc
ConvolutionDescriptor
Previously initialized convolution descriptor.
Previously initialized convolution descriptor .
algo
cudnnConvolutionBwdDataAlgo
Enumerant that specifies which backward data convolution algorithm shoud be used to compute the results
Enumerant that specifies which backward data convolution algorithm shoud be used to compute the results
workSpace
CudaDeviceVariable<byte>
Data pointer to GPU memory to a workspace needed to able to execute
the specified algorithm. If no workspace is needed for a particular
algorithm, that pointer can be nil
Data pointer to GPU memory to a workspace needed to able to execute the specified algorithm . If no workspace is needed for a particular algorithm that pointer can be nil
beta
double
Pointer to scaling factors (in host memory) used to blend the computation
result with prior value in the output layer as follows: dstValue
alpha[0]*result + beta[0]*priorDstValue. Please refer to this section for
additional details.
Pointer to scaling factors ( in host memory ) used to blend the computation result with prior value in the output layer as follows : dstValue alpha [ 0 ] * result + beta [ 0 ] * priorDstValue . Please refer to this section for additional details .
dxDesc
TensorDescriptor
Handle to the previously initialized output tensor descriptor.
Handle to the previously initialized output tensor descriptor .
dx
CudaDeviceVariable<double>
Data pointer to GPU memory associated with the output tensor descriptor
gradDesc that carries the result.
Data pointer to GPU memory associated with the output tensor descriptor gradDesc that carries the result .