cuLite v0.3.1
A lite CUDA C++ Interface
Loading...
Searching...
No Matches
culite::GridXD Class Reference

Base class for CUDA kernel grid configuration. More...

Inheritance diagram for culite::GridXD:

Public Member Functions

 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.

Protected Types

using cudaInt = unsigned int
 Type used by CUDA dim3 dimensions.

Detailed Description

Base class for CUDA kernel grid configuration.

GridXD provides the foundation for managing CUDA grid and block dimensions. It includes validation and overflow checking to ensure safe grid configurations. This is a base class for specialized 1D and 2D grid configurations.

Constructor & Destructor Documentation

◆ GridXD() [1/2]

culite::GridXD::GridXD ( )

Default constructor.

Creates a GridXD with default-initialized dimensions.

◆ GridXD() [2/2]

culite::GridXD::GridXD ( dim3 numBlocks,
dim3 threadsPerBlock )

Constructs a GridXD with explicit grid and block dimensions.

Parameters
numBlocksNumber of blocks in the grid.
threadsPerBlockNumber of threads per block.

Member Function Documentation

◆ numBlocks()

const dim3 & culite::GridXD::numBlocks ( ) const

Gets the number of blocks in the grid.

Returns
Reference to the dim3 structure containing block counts.

◆ threadsPerBlock()

const dim3 & culite::GridXD::threadsPerBlock ( ) const

Gets the number of threads per block.

Returns
Reference to the dim3 structure containing threads per block.