Execution Traits#

Execution traits can be retrieved directly from a Solver function descriptor, if the description is complete execution. The available execution traits may depend on the execution operator type used to build the descriptor: Thread Operator, Block Operator, or Cluster Operator.

Common Traits#

Common execution traits can be retrieved from descriptors built with Thread Operator, Block Operator, or Cluster Operator.

Trait

Description

Description::is_thread_execution

true if Description is a function description configured for thread execution, false otherwise.

Description::is_block_execution

true if Description is a function description configured for block execution, false otherwise.

Description::is_cluster_execution

true if Description is a function description configured for cluster execution, false otherwise.

Description::<a/b/x>_data_type

Data type of input and output data A, X, B.

Description::type

Type of input and output data A, X, B, either cusolverdx::type::real or cusolverdx::type::complex.

Description::<a/b>_precision

Precision of input and output data A, X, B, either float or double.

Description::status_type

Type of status output, for functions that return status.

Description::ld<a/b/c>

Leading dimensions of matrices.

Description::<a/b>_size

Number of elements in A and B matrices. Includes padding determined by set leading dimensions.

Description::<a/b/c>_arrangement

Memory layout for matrices.

Description::transpose

Transpose flag for A matrix.

Description::fill_mode

Fill mode for symmetric or Hermitian matrix A.

Description::side

Side of a matrix multiplication.

Description::diag

Whether the diagonal elements of matrix A are ones or not for trsm functions.

Description::job/jobu/jobvt

Option for computing eigenvectors or singular vectors.

Description::eig_type

Eig type for reduction of generalized, Hermitian-definite eigenvalue problem to the standard form - 1, 2, or 3.

Description::sm

Target architecture for the underlying computation.

Description::workspace_size

The size of the workspace in number of elements for temporary buffers for some functions such as heev, hegst, hegv, and gesvd.

Is Thread Execution Trait#

// bool
Solver::is_thread_execution

true if Description is a function description configured for thread execution, false otherwise.

Is Block Execution Trait#

// bool
Solver::is_block_execution

true if Description is a function description configured for block execution, false otherwise.

Is Cluster Execution Trait#

// bool
Solver::is_cluster_execution

true if Description is a function description configured for cluster execution, false otherwise.

Data Type Trait#

Solver::a_data_type
Solver::b_data_type
Solver::x_data_type

Data type for matrices A, X, and B, determined by Precision Operator and Type Operator. The supported data types are float, double, cuFloatComplex, and cuDoubleComplex.

Important

cuSolverDx does not support mixed precision currently, so matrices A, B and X are required to be the same data type.

Type Trait#

// cusolverdx::type
Solver::type

Type of input and output data A, X, B, determined by Type Operator. The supported types are cusolverdx::type::real and cusolverdx::type::complex.

Precision Trait#

// Precision type
Solver::a_precision
Solver::b_precision
Solver::x_precision

Precision of input and output data A, X, and B, determined by Precision Operator. The supported precisions are float and double.

Note

cuSolverDx does not support mixed precision currently, so matrices A, B and X are required to be the same precision. The limitation may be lifted in the future release.

Status Type Trait#

// int
Solver::status_type

Type of status output is integer for functions that return status.

Leading Dimension Trait#

// unsigned int
Solver::lda
Solver::ldb
Solver::ldc

Leading dimensions of matrices in the function. See LeadingDimension Operator.

Matrix Size Trait#

// unsigned int
Solver::a_size
Solver::b_size

Number of elements in A and B matrices, determined by the padding determined by the leading dimensions and the arrangement operator. See Arrangement Operator and LeadingDimension Operator.

Arrangement Trait#

// cusolverdx::arrangement
Solver::a_arrangement
Solver::b_arrangement
Solver::c_arrangement

Memory layout for matrices in the function. See Arrangement Operator.

Transpose Trait#

// cusolverdx::transpose
Solver::transpose

Transpose mode for A matrix. See TransposeMode Operator.

Fill Mode Trait#

// cusolverdx::fill_mode
Solver::fill_mode

Fill Mode of A matrix. See FillMode Operator.

Side Trait#

// cusolverdx::side
Solver::side

Side of a matrix multiplication. See Side Operator.

Diag Trait#

// cusolverdx::diag
Solver::diag

Indicates whether the diagonal elements of matrix A are ones or not for trsm functions. See Diag Operator.

Job Trait#

// cusolverdx::job
Solver::job    // returns eigenvectors or left singular vectors option
Solver::jobu   // same as Solver::job
Solver::jobvt  // returns right singular vectors option

Option for computing eigenvectors or singular vectors. See Job Operator.

Eig Type Trait#

// int
Solver::eig_type

The reduction type for the generalized, Hermitian-definite eigenvalue problem to the standard form. See EigType Operator.

SM Trait#

// unsigned int
Solver::sm

Target architecture for the underlying computation. See SM Operator.

Workspace Size Trait#

// unsigned int
Solver::workspace_size

The size of the workspace in number of elements required to allocate temporary buffer space for Solver functions. Currently the functions heev, hegst, hegv, and gesvd may require nonzero workspace (others use zero).

Note

Workspace size is in number of elements, therefore users need to allocate workspace memory with the size of (Solver::workspace_size * sizeof(Solver::a_data_type)).

Block Execution Traits#

Block execution traits can be retrieved from descriptors built with Block Operator. Using these traits with Thread Operator will result in a compilation error. Some traits are also available for descriptors built with Cluster Operator, for example, block_dim, max_threads_per_block, and shared_memory_size.

Trait

Description

Description::batches_per_block

Number of batches to execute in parallel in a single CUDA thread block.

Description::block_dim

Value of type dim3 representing number of threads computing Solver function.

Description::max_threads_per_block

Number of threads in Description::block_dim.

Description::shared_memory_size

The size of the shared memory in bytes required to allocate input and output matrices.

Batches Per Block Trait#

// unsigned int
Solver::batches_per_block

Number of batches to execute in parallel in a single CUDA thread block. See BatchesPerBlock Operator. The default value is 1 if the operator is not used.

Note

If BatchesPerBlock operator is not used in a Solver description, the default value of Solver::batches_per_block is 1, not Solver::suggested_batches_per_block.

Block Dim Trait#

// dim3
Solver::block_dim
cusolverdx::block_dim<Solver>::value
cusolverdx::block_dim_v<Solver>

Value of type dim3 representing number of threads that will be used to perform requested Solver function. The default value is Solver::suggested_block_dim if BlockDim Operator is not set.

Note

If BlockDim is not used in Solver description, the default value of Solver::block_dim is equal to Solver::suggested_block_dim.

Max Threads Per Block Trait#

// unsigned int
Solver::max_threads_per_block

Number of threads in Description::block_dim. Max threads per block is the product of the number of threads in each dimension of Description::block_dim.

Shared Memory Size Trait#

// unsigned int
Solver::shared_memory_size = Solver::get_shared_memory_size()

unsigned int Solver::get_shared_memory_size()
// Calculates shared memory size for dynamic leading dimensions
unsigned int Solver::get_shared_memory_size(unsigned int lda,
                                            unsigned int ldb,
                                            unsigned int ldc)

The size of the shared memory in bytes required to allocate input and output matrices, and perform computations.

The value is determined by Precision Operator, Type Operator, Size Operator, BatchesPerBlock Operator, Workspace Size Trait, and Function Operator.

Note

The shared memory size trait already takes into account Workspace Size Trait for functions that require extra workspace.

Cluster Execution Traits#

Cluster execution traits can be retrieved from descriptors built with Cluster Operator only. Using these traits with Thread Operator or Block Operator will result in a compilation error.

Trait

Description

Description::blocks_per_cluster

Number of thread blocks cooperating in one cluster.

Description::block_dim

Number of threads in each cluster CTA (same trait as block execution).

Description::max_threads_per_block

Number of threads in Description::block_dim.

Description::shared_memory_size

Bytes of dynamic shared memory in bytes required per CTA in the cluster (not the entire cluster) for the tile workspace.

Description::tile_size

Tile size used by the blocked cluster algorithm.

Blocks Per Cluster Trait#

// unsigned int
Solver::blocks_per_cluster

Number of thread blocks in one cluster. See BlocksPerCluster Operator.

Tile Size Trait#

// unsigned int
Solver::tile_size

Tile size for cluster POTRF. Equals TileSize Operator when set; otherwise equals Solver::suggested_tile_size.