Library/ManagedCuda/CudaDNN/CudaDNNContext.cs
/// <summary>
/// This function adds the scaled values of one bias tensor to another tensor. Each dimension
/// of the bias tensor must match the coresponding dimension of the srcDest tensor or
/// must be equal to 1. In the latter case, the same value from the bias tensor for thoses
/// dimensions will be used to blend into the srcDest tensor.
/// </summary>
/// <param name="alpha">Pointer to scaling factors (in host memory) used to blend the source
/// value with prior value in the destination tensor as follows: dstValue =
/// alpha[0]*srcValue + beta[0]*priorDstValue. Please refer to this section for
/// additional details.</param>
/// <param name="aDesc">Handle to a previously initialized tensor descriptor.</param>
/// <param name="a">Pointer to data of the tensor described by the biasDesc descriptor.</param>
/// <param name="beta">Pointer to scaling factors (in host memory) used to blend the source
/// value with prior value in the destination tensor as follows: dstValue =
/// alpha[0]*srcValue + beta[0]*priorDstValue. Please refer to this section for
/// additional details.</param>
/// <param name="cDesc">Handle to a previously initialized tensor descriptor.</param>
/// <param name="c">Pointer to data of the tensor described by the srcDestDesc descriptor.</param>
This function adds the scaled values of one bias tensor to another tensor. Each dimension
of the bias tensor must match the coresponding dimension of the srcDest tensor or
must be equal to 1. In the latter case, the same value from the bias tensor for thoses
dimensions will be used to blend into the srcDest tensor.
This function adds the scaled values of one bias tensor to another tensor . Each dimension of the bias tensor must match the coresponding dimension of the srcDest tensor or must be equal to 1 . In the latter case the same value from the bias tensor for thoses dimensions will be used to blend into the srcDest tensor .
public void AddTensor(float alpha,
                                    TensorDescriptor aDesc,
                                    CudaDeviceVariable<float> a,
                                    float beta,
                                    TensorDescriptor cDesc,
                                    CudaDeviceVariable<float> c
                                    )
        {
            res = CudaDNNNativeMethods.cudnnAddTensor(_handle, ref alpha, aDesc.Desc, a.DevicePointer, ref beta, cDesc.Desc, c.DevicePointer);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "cudnnAddTensor", res));
            if (res != cudnnStatus.Success) throw new CudaDNNException(res);
        }
public void AddTensor ( float alpha , TensorDescriptor aDesc , CudaDeviceVariable < float > a , float beta , TensorDescriptor cDesc , CudaDeviceVariable < float > c ) { res = CudaDNNNativeMethods . cudnnAddTensor ( _handle , ref alpha , aDesc . Desc , a . DevicePointer , ref beta , cDesc . Desc , c . DevicePointer ) ; Debug . WriteLine ( String . Format ( " " , DateTime . Now , " " , res ) ) ; if ( res != cudnnStatus . Success ) throw new CudaDNNException ( res ) ; }
This function adds the scaled values of one bias tensor to another tensor.
This function adds the scaled values of one bias tensor to another tensor .
alpha
float
Pointer to scaling factors (in host memory) used to blend the source
value with prior value in the destination tensor as follows: dstValue
alpha[0]*srcValue + beta[0]*priorDstValue. Please refer to this section for
additional details.
Pointer to scaling factors ( in host memory ) used to blend the source value with prior value in the destination tensor as follows : dstValue alpha [ 0 ] * srcValue + beta [ 0 ] * priorDstValue . Please refer to this section for additional details .
aDesc
TensorDescriptor
Handle to a previously initialized tensor descriptor.
Handle to a previously initialized tensor descriptor .
a
CudaDeviceVariable<float>
Pointer to data of the tensor described by the biasDesc descriptor.
Pointer to data of the tensor described by the biasDesc descriptor .
beta
float
Pointer to scaling factors (in host memory) used to blend the source
value with prior value in the destination tensor as follows: dstValue
alpha[0]*srcValue + beta[0]*priorDstValue. Please refer to this section for
additional details.
Pointer to scaling factors ( in host memory ) used to blend the source value with prior value in the destination tensor as follows : dstValue alpha [ 0 ] * srcValue + beta [ 0 ] * priorDstValue . Please refer to this section for additional details .
cDesc
TensorDescriptor
Handle to a previously initialized tensor descriptor.
Handle to a previously initialized tensor descriptor .
c
CudaDeviceVariable<float>
Pointer to data of the tensor described by the srcDestDesc descriptor.
Pointer to data of the tensor described by the srcDestDesc descriptor .