cuda-api-wrappers
Thin C++-flavored wrappers for the CUDA Runtime API
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
cuda::grid::dimensions_t Struct Reference

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>

Public Member Functions

constexpr __host__ __device__ dimensions_t (dimension_t x_=1, dimension_t y_=1, dimension_t z_=1)
 
constexpr __host__ __device__ dimensions_t (const uint3 &v)
 
constexpr __host__ __device__ dimensions_t (const dim3 &dims)
 
constexpr __host__ __device__ dimensions_t (dim3 &&dims)
 
constexpr __host__ __device__ operator uint3 (void) const
 
__host__ __device__ operator dim3 (void) const
 
constexpr __host__ __device__ size_t volume () const
 
constexpr __host__ __device__ dimensionality_t dimensionality () const
 

Static Public Member Functions

static constexpr __host__ __device__ dimensions_t cube (dimension_t x)
 
static constexpr __host__ __device__ dimensions_t square (dimension_t x)
 
static constexpr __host__ __device__ dimensions_t line (dimension_t x)
 
static constexpr __host__ __device__ dimensions_t point ()
 

Public Attributes

dimension_t x
 
dimension_t y
 
dimension_t z
 

Detailed Description

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
Unfortunately, dim3 does not have constexpr methods - preventing us from having constexpr methods here.
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.

The documentation for this struct was generated from the following file: