Library/ManagedCuda/CudaDNN/CudaDNNContext.cs
/// <summary>
/// This function computes the convolution gradient with respect to filter coefficients 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="xDesc">Handle to a previously initialized tensor descriptor.</param>
/// <param name="x">Data pointer to GPU memory associated with the tensor descriptor srcDesc.</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 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="dwDesc">Handle to a previously initialized filter descriptor.</param>
/// <param name="dw">Data pointer to GPU memory associated with the filter descriptor
/// gradDesc that carries the result.</param>    
This function computes the convolution gradient with respect to filter coefficients 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 filter coefficients 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 ConvolutionBackwardFilter(double alpha,
                                                TensorDescriptor xDesc,
                                                CudaDeviceVariable<double> x,
                                                TensorDescriptor dyDesc,
                                                CudaDeviceVariable<double> dy,
                                                ConvolutionDescriptor convDesc,
                                                cudnnConvolutionBwdFilterAlgo algo,
                                                CudaDeviceVariable<byte> workSpace,
                                                double beta,
                                                FilterDescriptor dwDesc,
                                                CudaDeviceVariable<double> dw
                                            )
        {
            res = CudaDNNNativeMethods.cudnnConvolutionBackwardFilter(_handle, ref alpha, xDesc.Desc, x.DevicePointer, dyDesc.Desc, dy.DevicePointer, convDesc.Desc, algo, workSpace.DevicePointer, workSpace.SizeInBytes, ref beta, dwDesc.Desc, dw.DevicePointer);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnConvolutionBackwardFilter", res));
            if (res != cudnnStatus.Success) throw new CudaDNNException(res);
        }
public void ConvolutionBackwardFilter ( double alpha , TensorDescriptor xDesc , CudaDeviceVariable < double > x , TensorDescriptor dyDesc , CudaDeviceVariable < double > dy , ConvolutionDescriptor convDesc , cudnnConvolutionBwdFilterAlgo algo , CudaDeviceVariable < byte > workSpace , double beta , FilterDescriptor dwDesc , CudaDeviceVariable < double > dw ) { res = CudaDNNNativeMethods . cudnnConvolutionBackwardFilter ( _handle , ref alpha , xDesc . Desc , x . DevicePointer , dyDesc . Desc , dy . DevicePointer , convDesc . Desc , algo , workSpace . DevicePointer , workSpace . SizeInBytes , ref beta , dwDesc . Desc , dw . 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 filter coefficients 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 filter coefficients 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 .
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 .
xDesc
TensorDescriptor
Handle to a previously initialized tensor descriptor.
Handle to a previously initialized tensor descriptor .
x
CudaDeviceVariable<double>
Data pointer to GPU memory associated with the tensor descriptor srcDesc.
Data pointer to GPU memory associated with the tensor descriptor srcDesc .
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
cudnnConvolutionBwdFilterAlgo
Enumerant that specifies which convolution algorithm shoud be used to compute the results
Enumerant that specifies which 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 .
dwDesc
FilterDescriptor
Handle to a previously initialized filter descriptor.
Handle to a previously initialized filter descriptor .
dw
CudaDeviceVariable<double>
Data pointer to GPU memory associated with the filter descriptor
gradDesc that carries the result.
Data pointer to GPU memory associated with the filter descriptor gradDesc that carries the result .