Library/ManagedCuda/CudaDNN/CudaDNNNativeMethods.cs
/// <summary>
/// This function implements the equation C = op ( alpha1[0] * A, alpha2[0] * B ) + beta[0] * C, given 
/// tensors A, B, and C and scaling factors alpha1, alpha2, and beta. The op to use is indicated by 
/// the descriptor opTensorDesc. Currently-supported ops are listed by the cudnnOpTensorOp_t enum. 
/// Each dimension of the input tensor A must match the corresponding dimension of the destination 
/// tensor C, and each dimension of the input tensor B must match the corresponding dimension of the 
/// destination tensor C or must be equal to 1. In the latter case, the same value from the input tensor 
/// B for those dimensions will be used to blend into the C tensor. The data types of the input tensors 
/// A and B must match. If the data type of the destination tensor C is double, then the data type of 
/// the input tensors also must be double. If the data type of the destination tensor C is double, then 
/// opTensorCompType in opTensorDesc must be double. Else opTensorCompType must be float. If the input 
/// tensor B is the same tensor as the destination tensor C, then the input tensor A also must be the 
/// same tensor as the destination tensor C.
/// </summary>        
/// <param name="handle">Handle to a previously created cuDNN context.</param>
/// <param name="opTensorDesc">Handle to a previously initialized op tensor descriptor.</param>
/// <param name="alpha1">Pointer to scaling factors(in host memory) used to blend the source value with prior value in the destination tensor as indicated by the above op equation.</param>
/// <param name="aDesc">Handle to a previously initialized tensor descriptor.</param>
/// <param name="A">Pointer to data of the tensors described by the aDesc descriptor.</param>
/// <param name="alpha2">Pointer to scaling factors(in host memory) used to blend the source value with prior value in the destination tensor as indicated by the above op equation.</param>
/// <param name="bDesc">Handle to a previously initialized tensor descriptor.</param>
/// <param name="B">Pointer to data of the tensors described by the bDesc 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 indicated by the above op equation.</param>
/// <param name="cDesc">Handle to a previously initialized tensor descriptor.</param>
/// <param name="C">Pointer to data of the tensor described by the cDesc descriptor.</param>
This function implements the equation C = op ( alpha1[0] * A, alpha2[0] * B ) + beta[0] * C, given
tensors A, B, and C and scaling factors alpha1, alpha2, and beta. The op to use is indicated by
the descriptor opTensorDesc. Currently-supported ops are listed by the cudnnOpTensorOp_t enum.
Each dimension of the input tensor A must match the corresponding dimension of the destination
tensor C, and each dimension of the input tensor B must match the corresponding dimension of the
destination tensor C or must be equal to 1. In the latter case, the same value from the input tensor
B for those dimensions will be used to blend into the C tensor. The data types of the input tensors
A and B must match. If the data type of the destination tensor C is double, then the data type of
the input tensors also must be double. If the data type of the destination tensor C is double, then
opTensorCompType in opTensorDesc must be double. Else opTensorCompType must be float. If the input
tensor B is the same tensor as the destination tensor C, then the input tensor A also must be the
same tensor as the destination tensor C.
This function implements the equation C = op ( alpha1 [ 0 ] * A alpha2 [ 0 ] * B ) + beta [ 0 ] * C given tensors A B and C and scaling factors alpha1 alpha2 and beta . The op to use is indicated by the descriptor opTensorDesc . Currently - supported ops are listed by the cudnnOpTensorOp_t enum . Each dimension of the input tensor A must match the corresponding dimension of the destination tensor C and each dimension of the input tensor B must match the corresponding dimension of the destination tensor C or must be equal to 1 . In the latter case the same value from the input tensor B for those dimensions will be used to blend into the C tensor . The data types of the input tensors A and B must match . If the data type of the destination tensor C is double then the data type of the input tensors also must be double . If the data type of the destination tensor C is double then opTensorCompType in opTensorDesc must be double . Else opTensorCompType must be float . If the input tensor B is the same tensor as the destination tensor C then the input tensor A also must be the same tensor as the destination tensor C .
[DllImport(CUDNN_API_DLL_NAME)]
        public static extern cudnnStatus cudnnOpTensor(
                                        cudnnHandle handle,
                                cudnnOpTensorDescriptor opTensorDesc,
                                ref double alpha1,
                                cudnnTensorDescriptor aDesc,
                                CUdeviceptr A,
                                ref double alpha2,
                                cudnnTensorDescriptor bDesc,
                                CUdeviceptr B,
                                ref double beta,
                                cudnnTensorDescriptor cDesc,
                                CUdeviceptr C);
[ DllImport ( CUDNN_API_DLL_NAME ) ] public static extern cudnnStatus cudnnOpTensor ( cudnnHandle handle , cudnnOpTensorDescriptor opTensorDesc , ref double alpha1 , cudnnTensorDescriptor aDesc , CUdeviceptr A , ref double alpha2 , cudnnTensorDescriptor bDesc , CUdeviceptr B , ref double beta , cudnnTensorDescriptor cDesc , CUdeviceptr C ) ;
This function implements the equation C = op ( alpha1[0] * A, alpha2[0] * B ) + beta[0] * C, given
tensors A, B, and C and scaling factors alpha1, alpha2, and beta.
This function implements the equation C = op ( alpha1 [ 0 ] * A alpha2 [ 0 ] * B ) + beta [ 0 ] * C given tensors A B and C and scaling factors alpha1 alpha2 and beta .
handle
cudnnHandle
Handle to a previously created cuDNN context.
Handle to a previously created cuDNN context .
opTensorDesc
cudnnOpTensorDescriptor
Handle to a previously initialized op tensor descriptor.
Handle to a previously initialized op tensor descriptor .
double
ref
<not_specific>
aDesc
cudnnTensorDescriptor
Handle to a previously initialized tensor descriptor.
Handle to a previously initialized tensor descriptor .
A
CUdeviceptr
Pointer to data of the tensors described by the aDesc descriptor.
Pointer to data of the tensors described by the aDesc descriptor .
bDesc
cudnnTensorDescriptor
Handle to a previously initialized tensor descriptor.
Handle to a previously initialized tensor descriptor .
B
CUdeviceptr
Pointer to data of the tensors described by the bDesc descriptor.
Pointer to data of the tensors described by the bDesc descriptor .
cDesc
cudnnTensorDescriptor
Handle to a previously initialized tensor descriptor.
Handle to a previously initialized tensor descriptor .
C
CUdeviceptr
Pointer to data of the tensor described by the cDesc descriptor.
Pointer to data of the tensor described by the cDesc descriptor .
alpha1
<not_specific>
Pointer to scaling factors(in host memory) used to blend the source value with prior value in the destination tensor as indicated by the above op equation.
Pointer to scaling factors ( in host memory ) used to blend the source value with prior value in the destination tensor as indicated by the above op equation .
alpha2
<not_specific>
Pointer to scaling factors(in host memory) used to blend the source value with prior value in the destination tensor as indicated by the above op equation.
Pointer to scaling factors ( in host memory ) used to blend the source value with prior value in the destination tensor as indicated by the above op equation .
beta
<not_specific>
Pointer to scaling factors(in host memory) used to blend the source value with prior value in the destination tensor as indicated by the above op equation.
Pointer to scaling factors ( in host memory ) used to blend the source value with prior value in the destination tensor as indicated by the above op equation .