Library/ManagedCuda/CudaDNN/CudaDNNContext.cs
/// <summary>
/// This routine computes the softmax function.
/// </summary>
/// <param name="algorithm">Enumerant to specify the softmax algorithm.</param>
/// <param name="mode">Enumerant to specify the softmax mode.</param>
/// <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 the previously initialized input tensor descriptor.</param>
/// <param name="x">Data pointer to GPU memory associated with the tensor descriptor srcDesc.</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 the previously initialized output tensor descriptor.</param>
/// <param name="y">Data pointer to GPU memory associated with the output tensor descriptor destDesc.</param>
This routine computes the softmax function.
This routine computes the softmax function .
public void SoftmaxForward(cudnnSoftmaxAlgorithm algorithm,
                                    cudnnSoftmaxMode mode,
                                    double alpha,
                                    TensorDescriptor xDesc,
                                    CudaDeviceVariable<double> x,
                                    double beta,
                                    TensorDescriptor yDesc,
                                    CudaDeviceVariable<double> y
                                    )
        {
            res = CudaDNNNativeMethods.cudnnSoftmaxForward(_handle, algorithm, mode, ref alpha, xDesc.Desc, x.DevicePointer, ref beta, yDesc.Desc, y.DevicePointer);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnSoftmaxForward", res));
            if (res != cudnnStatus.Success) throw new CudaDNNException(res);
        }
public void SoftmaxForward ( cudnnSoftmaxAlgorithm algorithm , cudnnSoftmaxMode mode , double alpha , TensorDescriptor xDesc , CudaDeviceVariable < double > x , double beta , TensorDescriptor yDesc , CudaDeviceVariable < double > y ) { res = CudaDNNNativeMethods . cudnnSoftmaxForward ( _handle , algorithm , mode , ref alpha , xDesc . Desc , x . DevicePointer , ref beta , yDesc . Desc , y . DevicePointer ) ; Debug . WriteLine ( String . Format ( " " , DateTime . Now , " " , res ) ) ; if ( res != cudnnStatus . Success ) throw new CudaDNNException ( res ) ; }
This routine computes the softmax function.
This routine computes the softmax function .
algorithm
cudnnSoftmaxAlgorithm
Enumerant to specify the softmax algorithm.
Enumerant to specify the softmax algorithm .
mode
cudnnSoftmaxMode
Enumerant to specify the softmax mode.
Enumerant to specify the softmax mode .
alpha
double
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 the previously initialized input tensor descriptor.
Handle to the previously initialized input tensor descriptor .
x
CudaDeviceVariable<double>
Data pointer to GPU memory associated with the tensor descriptor srcDesc.
Data pointer to GPU memory associated with the tensor descriptor srcDesc .
beta
double
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 the previously initialized output tensor descriptor.
Handle to the previously initialized output tensor descriptor .
y
CudaDeviceVariable<double>
Data pointer to GPU memory associated with the output tensor descriptor destDesc.
Data pointer to GPU memory associated with the output tensor descriptor destDesc .