Library/ManagedCuda/CudaDNN/CudaDNNContext.cs
/// <summary>
/// This function attempts all cuDNN algorithms for cudnnConvolutionBackwardFilter_v3 and outputs performance metrics to a user-
/// allocated array of cudnnConvolutionBwdFilterAlgoPerf_t. These metrics are
/// written in sorted fashion where the first element has the lowest compute time. 
/// </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="dwDesc">Handle to a previously initialized filter descriptor.</param>
/// <param name="requestedAlgoCount">The maximum number of elements to be stored in perfResults.</param>
/// <returns>An array to store performance metrics sorted ascending by compute time.</returns>
This function attempts all cuDNN algorithms for cudnnConvolutionBackwardFilter_v3 and outputs performance metrics to a user
allocated array of cudnnConvolutionBwdFilterAlgoPerf_t. These metrics are
written in sorted fashion where the first element has the lowest compute time.
This function attempts all cuDNN algorithms for cudnnConvolutionBackwardFilter_v3 and outputs performance metrics to a user allocated array of cudnnConvolutionBwdFilterAlgoPerf_t . These metrics are written in sorted fashion where the first element has the lowest compute time .
public cudnnConvolutionBwdFilterAlgoPerf[] FindConvolutionBackwardFilterAlgorithm(TensorDescriptor xDesc,
                                                            TensorDescriptor dyDesc,
                                                            ConvolutionDescriptor convDesc,
                                                            FilterDescriptor dwDesc,
                                                            int requestedAlgoCount
                                                            )
        {
            cudnnConvolutionBwdFilterAlgoPerf[] temp = new cudnnConvolutionBwdFilterAlgoPerf[requestedAlgoCount];
            int returnedAlgoCount = 0;
            res = CudaDNNNativeMethods.cudnnFindConvolutionBackwardFilterAlgorithm(_handle, xDesc.Desc, dyDesc.Desc, convDesc.Desc, dwDesc.Desc, requestedAlgoCount, ref returnedAlgoCount, temp);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnFindConvolutionBackwardFilterAlgorithm", res));
            if (res != cudnnStatus.Success) throw new CudaDNNException(res);
            if (returnedAlgoCount <= 0) return null;
            cudnnConvolutionBwdFilterAlgoPerf[] perfResults = new cudnnConvolutionBwdFilterAlgoPerf[returnedAlgoCount];
            Array.Copy(temp, perfResults, returnedAlgoCount);
            return perfResults;
        }
public cudnnConvolutionBwdFilterAlgoPerf [ ] FindConvolutionBackwardFilterAlgorithm ( TensorDescriptor xDesc , TensorDescriptor dyDesc , ConvolutionDescriptor convDesc , FilterDescriptor dwDesc , int requestedAlgoCount ) { cudnnConvolutionBwdFilterAlgoPerf [ ] temp = new cudnnConvolutionBwdFilterAlgoPerf [ requestedAlgoCount ] ; int returnedAlgoCount = 0 ; res = CudaDNNNativeMethods . cudnnFindConvolutionBackwardFilterAlgorithm ( _handle , xDesc . Desc , dyDesc . Desc , convDesc . Desc , dwDesc . Desc , requestedAlgoCount , ref returnedAlgoCount , temp ) ; Debug . WriteLine ( String . Format ( " " , DateTime . Now , " " , res ) ) ; if ( res != cudnnStatus . Success ) throw new CudaDNNException ( res ) ; if ( returnedAlgoCount <= 0 ) return null ; cudnnConvolutionBwdFilterAlgoPerf [ ] perfResults = new cudnnConvolutionBwdFilterAlgoPerf [ returnedAlgoCount ] ; Array . Copy ( temp , perfResults , returnedAlgoCount ) ; return perfResults ; }
This function attempts all cuDNN algorithms for cudnnConvolutionBackwardFilter_v3 and outputs performance metrics to a user
allocated array of cudnnConvolutionBwdFilterAlgoPerf_t.
This function attempts all cuDNN algorithms for cudnnConvolutionBackwardFilter_v3 and outputs performance metrics to a user allocated array of cudnnConvolutionBwdFilterAlgoPerf_t .
An array to store performance metrics sorted ascending by compute time.
An array to store performance metrics sorted ascending by compute time .
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 .
dwDesc
FilterDescriptor
Handle to a previously initialized filter descriptor.
Handle to a previously initialized filter descriptor .
requestedAlgoCount
int
The maximum number of elements to be stored in perfResults.
The maximum number of elements to be stored in perfResults .