A richer (kind-of-a-)wrapper for CUDA's dim3
class, used to specify dimensions for blocks (in terms of threads) and of grids(in terms of blocks, or overall).
More...
#include <types.hpp>
|
constexpr __host__ __device__ | dimensions_t (dimension_t x_=1, dimension_t y_=1, dimension_t z_=1) noexcept |
|
constexpr __host__ __device__ | dimensions_t (const uint3 &v) noexcept |
|
constexpr __host__ __device__ | dimensions_t (const dim3 &dims) noexcept |
|
constexpr __host__ __device__ | dimensions_t (dim3 &&dims) noexcept |
|
constexpr __host__ __device__ | operator uint3 (void) const |
|
__host__ __device__ | operator dim3 (void) const noexcept |
|
constexpr __host__ __device__ size_t | volume () const noexcept |
| The number of total elements in a 3D object with these dimensions.
|
|
constexpr __host__ __device__ dimensionality_t | dimensionality () const noexcept |
| Number of dimensions in which this dimension structure is non-trivial, i.e. More...
|
|
|
constexpr dimension_t | operator[] (int i) const noexcept |
| Provides array-like access to the dimensions in different axes. More...
|
|
CPP14_CONSTEXPR dimension_t & | operator[] (int i) noexcept |
|
A richer (kind-of-a-)wrapper for CUDA's dim3
class, used to specify dimensions for blocks (in terms of threads) and of grids(in terms of blocks, or overall).
- Note
- Unlike 3D dimensions in general, grid dimensions cannot actually be empty: A grid must have some threads. Thus, the value in each axis must be positive when an instance of this class is used in a kernel launch configuration.
◆ dimensionality()
constexpr __host__ __device__ dimensionality_t cuda::grid::dimensions_t::dimensionality |
( |
| ) |
const |
|
inlinenoexcept |
Number of dimensions in which this dimension structure is non-trivial, i.e.
coordinates can have more than a single value
◆ divides()
- Returns
- true if the dimensions on the left-hand side divide, elementwise, those on the right-hand side
◆ operator[]()
constexpr dimension_t cuda::grid::dimensions_t::operator[] |
( |
int |
i | ) |
const |
|
inlinenoexcept |
Provides array-like access to the dimensions in different axes.
- Note
- Behavior only defined for i between 0 and 2
The documentation for this struct was generated from the following file: