Library/ManagedCuda/CudaDNN/CudaDNNContext.cs
/// <summary>
/// This function executes convolutions or cross-correlations over src using the specified
/// filters, returning results in dest. 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="wDesc">Handle to a previously initialized filter descriptor.</param>
/// <param name="w">Data pointer to GPU memory associated with the filter descriptor filterDesc.</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="yDesc">Handle to a previously initialized tensor descriptor.</param>
/// <param name="y">Data pointer to GPU memory associated with the tensor descriptor
/// destDesc that carries the result of the convolution.</param>
This function executes convolutions or cross-correlations over src using the specified
filters, returning results in dest. Scaling factors alpha and beta can be used to scale
the input tensor and the output tensor respectively.
This function executes convolutions or cross - correlations over src using the specified filters returning results in dest . Scaling factors alpha and beta can be used to scale the input tensor and the output tensor respectively .
public void ConvolutionForward(float alpha,
                                        TensorDescriptor xDesc,
                                        CudaDeviceVariable<float> x,
                                        FilterDescriptor wDesc,
                                        CudaDeviceVariable<float> w,
                                        ConvolutionDescriptor convDesc,
                                        cudnnConvolutionFwdAlgo algo,
                                        CudaDeviceVariable<byte> workSpace,
                                        float beta,
                                        TensorDescriptor yDesc,
                                        CudaDeviceVariable<float> y
                                    )
        {
            res = CudaDNNNativeMethods.cudnnConvolutionForward(_handle, ref alpha, xDesc.Desc, x.DevicePointer, wDesc.Desc, w.DevicePointer, convDesc.Desc, algo, workSpace.DevicePointer, workSpace.SizeInBytes, ref beta, yDesc.Desc, y.DevicePointer);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnConvolutionForward", res));
            if (res != cudnnStatus.Success) throw new CudaDNNException(res);
        }
public void ConvolutionForward ( float alpha , TensorDescriptor xDesc , CudaDeviceVariable < float > x , FilterDescriptor wDesc , CudaDeviceVariable < float > w , ConvolutionDescriptor convDesc , cudnnConvolutionFwdAlgo algo , CudaDeviceVariable < byte > workSpace , float beta , TensorDescriptor yDesc , CudaDeviceVariable < float > y ) { res = CudaDNNNativeMethods . cudnnConvolutionForward ( _handle , ref alpha , xDesc . Desc , x . DevicePointer , wDesc . Desc , w . DevicePointer , convDesc . Desc , algo , workSpace . DevicePointer , workSpace . SizeInBytes , ref beta , yDesc . Desc , y . DevicePointer ) ; Debug . WriteLine ( String . Format ( " " , DateTime . Now , " " , res ) ) ; if ( res != cudnnStatus . Success ) throw new CudaDNNException ( res ) ; }
This function executes convolutions or cross-correlations over src using the specified
filters, returning results in dest.
This function executes convolutions or cross - correlations over src using the specified filters returning results in dest .
alpha
float
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<float>
Data pointer to GPU memory associated with the tensor descriptor srcDesc.
Data pointer to GPU memory associated with the tensor descriptor srcDesc .
wDesc
FilterDescriptor
Handle to a previously initialized filter descriptor.
Handle to a previously initialized filter descriptor .
w
CudaDeviceVariable<float>
Data pointer to GPU memory associated with the filter descriptor filterDesc.
Data pointer to GPU memory associated with the filter descriptor filterDesc .
convDesc
ConvolutionDescriptor
Previously initialized convolution descriptor.
Previously initialized convolution descriptor .
algo
cudnnConvolutionFwdAlgo
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
float
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 .
yDesc
TensorDescriptor
Handle to a previously initialized tensor descriptor.
Handle to a previously initialized tensor descriptor .
y
CudaDeviceVariable<float>
Data pointer to GPU memory associated with the tensor descriptor
destDesc that carries the result of the convolution.
Data pointer to GPU memory associated with the tensor descriptor destDesc that carries the result of the convolution .