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 cudnnConvolutionBackwardData_v3 with the
/// specified algorithm. The workspace allocated will then be passed to the routine
/// cudnnConvolutionBackwardData_v3. The specified algorithm can be the result of the
/// call to cudnnGetConvolutionBackwardDataAlgorithm 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="wDesc">Handle to a previously initialized filter 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="dxDesc">Handle to the previously initialized output tensor descriptor.</param>
/// <param name="algo">Enumerant that specifies the chosen convolution algorithm</param>
This function returns the amount of GPU memory workspace the user needs
to allocate to be able to call cudnnConvolutionBackwardData_v3 with the
specified algorithm. The workspace allocated will then be passed to the routine
cudnnConvolutionBackwardData_v3. The specified algorithm can be the result of the
call to cudnnGetConvolutionBackwardDataAlgorithm 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 cudnnConvolutionBackwardData_v3 with the specified algorithm . The workspace allocated will then be passed to the routine cudnnConvolutionBackwardData_v3 . The specified algorithm can be the result of the call to cudnnGetConvolutionBackwardDataAlgorithm 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 GetConvolutionBackwardDataWorkspaceSize(FilterDescriptor wDesc,
                                                            TensorDescriptor dyDesc,
                                                            ConvolutionDescriptor convDesc,
                                                            TensorDescriptor dxDesc,
                                                            cudnnConvolutionBwdDataAlgo algo
                                                        )
        {
            SizeT sizeInBytes = new SizeT();
            res = CudaDNNNativeMethods.cudnnGetConvolutionBackwardDataWorkspaceSize(_handle, wDesc.Desc, dyDesc.Desc, convDesc.Desc, dxDesc.Desc, algo, ref sizeInBytes);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnGetConvolutionBackwardDataWorkspaceSize", res));
            if (res != cudnnStatus.Success) throw new CudaDNNException(res);
            return sizeInBytes;
        }
public SizeT GetConvolutionBackwardDataWorkspaceSize ( FilterDescriptor wDesc , TensorDescriptor dyDesc , ConvolutionDescriptor convDesc , TensorDescriptor dxDesc , cudnnConvolutionBwdDataAlgo algo ) { SizeT sizeInBytes = new SizeT ( ) ; res = CudaDNNNativeMethods . cudnnGetConvolutionBackwardDataWorkspaceSize ( _handle , wDesc . Desc , dyDesc . Desc , convDesc . Desc , dxDesc . 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 cudnnConvolutionBackwardData_v3 with the
specified algorithm.
This function returns the amount of GPU memory workspace the user needs to allocate to be able to call cudnnConvolutionBackwardData_v3 with the specified algorithm .
wDesc
FilterDescriptor
Handle to a previously initialized filter descriptor.
Handle to a previously initialized filter 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 .
dxDesc
TensorDescriptor
Handle to the previously initialized output tensor descriptor.
Handle to the previously initialized output tensor descriptor .
algo
cudnnConvolutionBwdDataAlgo
Enumerant that specifies the chosen convolution algorithm
Enumerant that specifies the chosen convolution algorithm