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

Public Member Functions | |
| Grid1D () | |
| Default constructor. | |
| Grid1D (std::size_t n, std::size_t blockSize=256) | |
| Constructs a 1D grid configuration. | |
| ~Grid1D () | |
| 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. | |
1D CUDA kernel grid configuration.
Grid1D simplifies configuration for 1D kernels by automatically calculating the number of blocks needed to cover n elements with the specified block size.
| culite::Grid1D::Grid1D | ( | ) |
Default constructor.
Creates a Grid1D with default-initialized dimensions.
| culite::Grid1D::Grid1D | ( | std::size_t | n, |
| std::size_t | blockSize = 256 ) |
Constructs a 1D grid configuration.
Automatically calculates the number of blocks needed to cover n elements with the given block size. Performs overflow and validation checks.
| n | Total number of elements to process. |
| blockSize | Number of threads per block (default: 256). |
| err::CudaException | if blockSize is zero, if arithmetic overflow occurs, or if calculated values exceed unsigned int maximum. |