Library/ManagedCuda/CudaDNN/CudaDNNContext.cs
/// <summary>
/// This function returns the amount of GPU memory workspace the user needs
/// to allocate to be able to call cudnnConvolutionBackwardFilter_v3 with the
/// specified algorithm. The workspace allocated will then be passed to the routine
/// cudnnConvolutionBackwardFilter_v3. The specified algorithm can be the result
/// of the call to cudnnGetConvolutionBackwardFilterAlgorithm or can be chosen
/// arbitrarily by the user. Note that not every algorithm is available for every configuration
/// of the input tensor and/or every configuration of the convolution descriptor.
/// </summary>
/// <param name = "xDesc" > Handle to the previously initialized input tensor descriptor.</param>
/// <param name="dyDesc">Handle to the previously initialized input differential tensor descriptor.</param>
/// <param name="convDesc">Previously initialized convolution descriptor.</param>
/// <param name="gradDesc">Handle to a previously initialized filter descriptor.</param>
/// <param name="algo">Enumerant that specifies the chosen convolution algorithm
/// sizeInBytes output Amount of GPU memory needed as workspace to be able to execute</param>
/// <returns>Amount of GPU memory needed as workspace to be able to execute a
/// forward convolution with the specified algo</returns>
This function returns the amount of GPU memory workspace the user needs
to allocate to be able to call cudnnConvolutionBackwardFilter_v3 with the
specified algorithm. The workspace allocated will then be passed to the routine
cudnnConvolutionBackwardFilter_v3. The specified algorithm can be the result
of the call to cudnnGetConvolutionBackwardFilterAlgorithm or can be chosen
arbitrarily by the user. Note that not every algorithm is available for every configuration
of the input tensor and/or every configuration of the convolution descriptor.
This function returns the amount of GPU memory workspace the user needs to allocate to be able to call cudnnConvolutionBackwardFilter_v3 with the specified algorithm . The workspace allocated will then be passed to the routine cudnnConvolutionBackwardFilter_v3 . The specified algorithm can be the result of the call to cudnnGetConvolutionBackwardFilterAlgorithm or can be chosen arbitrarily by the user . Note that not every algorithm is available for every configuration of the input tensor and / or every configuration of the convolution descriptor .
public SizeT GetConvolutionBackwardFilterWorkspaceSize(TensorDescriptor xDesc,
                                                                    TensorDescriptor dyDesc,
                                                                    ConvolutionDescriptor convDesc,
                                                                    FilterDescriptor gradDesc,
                                                                    cudnnConvolutionBwdFilterAlgo algo
                                                                )
        {
            SizeT sizeInBytes = new SizeT();
            res = CudaDNNNativeMethods.cudnnGetConvolutionBackwardFilterWorkspaceSize(_handle, xDesc.Desc, dyDesc.Desc, convDesc.Desc, gradDesc.Desc, algo, ref sizeInBytes);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnGetConvolutionBackwardFilterWorkspaceSize", res));
            if (res != cudnnStatus.Success) throw new CudaDNNException(res);
            return sizeInBytes;
        }
public SizeT GetConvolutionBackwardFilterWorkspaceSize ( TensorDescriptor xDesc , TensorDescriptor dyDesc , ConvolutionDescriptor convDesc , FilterDescriptor gradDesc , cudnnConvolutionBwdFilterAlgo algo ) { SizeT sizeInBytes = new SizeT ( ) ; res = CudaDNNNativeMethods . cudnnGetConvolutionBackwardFilterWorkspaceSize ( _handle , xDesc . Desc , dyDesc . Desc , convDesc . Desc , gradDesc . Desc , algo , ref sizeInBytes ) ; Debug . WriteLine ( String . Format ( " " , DateTime . Now , " " , res ) ) ; if ( res != cudnnStatus . Success ) throw new CudaDNNException ( res ) ; return sizeInBytes ; }
This function returns the amount of GPU memory workspace the user needs
to allocate to be able to call cudnnConvolutionBackwardFilter_v3 with the
specified algorithm.
This function returns the amount of GPU memory workspace the user needs to allocate to be able to call cudnnConvolutionBackwardFilter_v3 with the specified algorithm .
Amount of GPU memory needed as workspace to be able to execute a
forward convolution with the specified algo
Amount of GPU memory needed as workspace to be able to execute a forward convolution with the specified algo
xDesc
TensorDescriptor
Handle to the previously initialized input tensor descriptor.
Handle to the previously initialized input tensor descriptor .
dyDesc
TensorDescriptor
Handle to the previously initialized input differential tensor descriptor.
Handle to the previously initialized input differential tensor descriptor .
convDesc
ConvolutionDescriptor
Previously initialized convolution descriptor.
Previously initialized convolution descriptor .
gradDesc
FilterDescriptor
Handle to a previously initialized filter descriptor.
Handle to a previously initialized filter descriptor .
algo
cudnnConvolutionBwdFilterAlgo
Enumerant that specifies the chosen convolution algorithm
sizeInBytes output Amount of GPU memory needed as workspace to be able to execute
Enumerant that specifies the chosen convolution algorithm sizeInBytes output Amount of GPU memory needed as workspace to be able to execute