Library/ManagedCuda/CudaDNN/CudaDNNContext.cs
/// <summary>
/// This function serves as a heuristic for obtaining the best suited algorithm for
/// cudnnConvolutionBackwardData for the given layer specifications.This function
/// will return all algorithms sorted by expected (based on internal heuristic) relative
/// performance with fastest being index 0 of perfResults.For an exhaustive search for the
/// fastest algorithm, please use cudnnFindConvolutionBackwardDataAlgorithm.
/// </summary>
/// <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="requestedAlgoCount">The maximum number of elements to be stored in perfResults.</param>
/// <param name="filterDesc">Handle to a previously initialized filter descriptor.</param>
/// <returns>array to store performance metrics sorted ascending by compute time.</returns>
This function serves as a heuristic for obtaining the best suited algorithm for
cudnnConvolutionBackwardData for the given layer specifications.This function
will return all algorithms sorted by expected (based on internal heuristic) relative
performance with fastest being index 0 of perfResults.For an exhaustive search for the
fastest algorithm, please use cudnnFindConvolutionBackwardDataAlgorithm.
This function serves as a heuristic for obtaining the best suited algorithm for cudnnConvolutionBackwardData for the given layer specifications . This function will return all algorithms sorted by expected ( based on internal heuristic ) relative performance with fastest being index 0 of perfResults . For an exhaustive search for the fastest algorithm please use cudnnFindConvolutionBackwardDataAlgorithm .
public cudnnConvolutionBwdDataAlgoPerf[] GetConvolutionBackwardDataAlgorithm(
                                                    FilterDescriptor filterDesc, TensorDescriptor dyDesc,
                                                    ConvolutionDescriptor convDesc,TensorDescriptor dxDesc,
                                                    int requestedAlgoCount
                                                    )
        {
            cudnnConvolutionBwdDataAlgoPerf[] algos = new cudnnConvolutionBwdDataAlgoPerf[requestedAlgoCount];
            int returnedAlgoCount = 0;
            res = CudaDNNNativeMethods.cudnnGetConvolutionBackwardDataAlgorithm_v7(_handle, filterDesc.Desc, dyDesc.Desc, convDesc.Desc, dxDesc.Desc, requestedAlgoCount, ref returnedAlgoCount, algos);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnGetConvolutionBackwardDataAlgorithm_v7", res));
            if (res != cudnnStatus.Success) throw new CudaDNNException(res);
            if (returnedAlgoCount != requestedAlgoCount)
            {
                cudnnConvolutionBwdDataAlgoPerf[] temp = new cudnnConvolutionBwdDataAlgoPerf[returnedAlgoCount];
                Array.Copy(algos, temp, returnedAlgoCount);
                algos = temp;
            }
            return algos;
        }
public cudnnConvolutionBwdDataAlgoPerf [ ] GetConvolutionBackwardDataAlgorithm ( FilterDescriptor filterDesc , TensorDescriptor dyDesc , ConvolutionDescriptor convDesc , TensorDescriptor dxDesc , int requestedAlgoCount ) { cudnnConvolutionBwdDataAlgoPerf [ ] algos = new cudnnConvolutionBwdDataAlgoPerf [ requestedAlgoCount ] ; int returnedAlgoCount = 0 ; res = CudaDNNNativeMethods . cudnnGetConvolutionBackwardDataAlgorithm_v7 ( _handle , filterDesc . Desc , dyDesc . Desc , convDesc . Desc , dxDesc . Desc , requestedAlgoCount , ref returnedAlgoCount , algos ) ; Debug . WriteLine ( String . Format ( " " , DateTime . Now , " " , res ) ) ; if ( res != cudnnStatus . Success ) throw new CudaDNNException ( res ) ; if ( returnedAlgoCount != requestedAlgoCount ) { cudnnConvolutionBwdDataAlgoPerf [ ] temp = new cudnnConvolutionBwdDataAlgoPerf [ returnedAlgoCount ] ; Array . Copy ( algos , temp , returnedAlgoCount ) ; algos = temp ; } return algos ; }
This function serves as a heuristic for obtaining the best suited algorithm for
cudnnConvolutionBackwardData for the given layer specifications.This function
will return all algorithms sorted by expected (based on internal heuristic) relative
performance with fastest being index 0 of perfResults.For an exhaustive search for the
fastest algorithm, please use cudnnFindConvolutionBackwardDataAlgorithm.
This function serves as a heuristic for obtaining the best suited algorithm for cudnnConvolutionBackwardData for the given layer specifications . This function will return all algorithms sorted by expected ( based on internal heuristic ) relative performance with fastest being index 0 of perfResults . For an exhaustive search for the fastest algorithm please use cudnnFindConvolutionBackwardDataAlgorithm .
array to store performance metrics sorted ascending by compute time.
array to store performance metrics sorted ascending by compute time .
filterDesc
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 .
requestedAlgoCount
int
The maximum number of elements to be stored in perfResults.
The maximum number of elements to be stored in perfResults .