Library/ManagedCuda/CudaDNN/CudaDNNContext.cs
/// <summary>
/// This routine applies a specified neuron activation function element-wise over each input value.
/// </summary>
/// <param name="activationDesc">Handle to the previously created activation descriptor object.</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 applies a specified neuron activation function element-wise over each input value.
This routine applies a specified neuron activation function element - wise over each input value .
public void ActivationForward(ActivationDescriptor activationDesc,
                                        float alpha,
                                        TensorDescriptor xDesc,
                                        CudaDeviceVariable<float> x,
                                        float beta,
                                        TensorDescriptor yDesc,
                                        CudaDeviceVariable<float> y
                                    )
        {
            res = CudaDNNNativeMethods.cudnnActivationForward(_handle, activationDesc.Desc, ref alpha, xDesc.Desc, x.DevicePointer, ref beta, yDesc.Desc, y.DevicePointer);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnActivationForward", res));
            if (res != cudnnStatus.Success) throw new CudaDNNException(res);
        }
public void ActivationForward ( ActivationDescriptor activationDesc , float alpha , TensorDescriptor xDesc , CudaDeviceVariable < float > x , float beta , TensorDescriptor yDesc , CudaDeviceVariable < float > y ) { res = CudaDNNNativeMethods . cudnnActivationForward ( _handle , activationDesc . Desc , 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 applies a specified neuron activation function element-wise over each input value.
This routine applies a specified neuron activation function element - wise over each input value .
activationDesc
ActivationDescriptor
Handle to the previously created activation descriptor object.
Handle to the previously created activation descriptor object .
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 the previously initialized input tensor descriptor.
Handle to the previously initialized input 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 .
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 the previously initialized output tensor descriptor.
Handle to the previously initialized output tensor descriptor .
y
CudaDeviceVariable<float>
Data pointer to GPU memory associated with the output tensor descriptor destDesc.
Data pointer to GPU memory associated with the output tensor descriptor destDesc .