![]() |
cuLite v0.3.1
A lite CUDA C++ Interface
|
2D CUDA kernel grid configuration. More...

Public Member Functions | |
| Grid2D () | |
| Default constructor. | |
| Grid2D (std::size_t m, std::size_t n, std::size_t blockSizeX=16, std::size_t blockSizeY=16) | |
| Constructs a 2D grid configuration with explicit block dimensions. | |
| ~Grid2D () | |
| Default destructor. | |
| Public Member Functions inherited from culite::GridXD | |
| GridXD () | |
| Default constructor. | |
| GridXD (dim3 numBlocks, dim3 threadsPerBlock) | |
| Constructs a GridXD with explicit grid and block dimensions. | |
| ~GridXD () | |
| Default destructor. | |
| const dim3 & | numBlocks () const |
| Gets the number of blocks in the grid. | |
| const dim3 & | threadsPerBlock () const |
| Gets the number of threads per block. | |
Additional Inherited Members | |
| Protected Types inherited from culite::GridXD | |
| using | cudaInt = unsigned int |
| Type used by CUDA dim3 dimensions. | |
2D CUDA kernel grid configuration.
Grid2D simplifies configuration for 2D kernels (e.g., matrix operations) by automatically calculating the number of blocks needed to cover m×n elements with the specified block dimensions. Optimized for column-major matrices.
| culite::Grid2D::Grid2D | ( | ) |
Default constructor.
Creates a Grid2D with default-initialized dimensions.
| culite::Grid2D::Grid2D | ( | std::size_t | m, |
| std::size_t | n, | ||
| std::size_t | blockSizeX = 16, | ||
| std::size_t | blockSizeY = 16 ) |
Constructs a 2D grid configuration with explicit block dimensions.
Automatically calculates the number of blocks needed in X and Y dimensions to cover m×n elements with the given block sizes. Performs overflow and validation checks.
| m | Number of elements in the X dimension (rows). |
| n | Number of elements in the Y dimension (columns). |
| blockSizeX | Number of threads per block in X dimension (default: 16). |
| blockSizeY | Number of threads per block in Y dimension (default: 16). |
| err::CudaException | if block sizes are zero, if arithmetic overflow occurs, or if calculated values exceed unsigned int maximum. |