cuda::experimental::level_dimensions

Defined in include/cuda/experimental/__hierarchy/level_dimensions.cuh

template<typename Level, typename Dimensions>
struct level_dimensions

Type representing dimensions of a level in a thread hierarchy.

This type combines a level type like grid_level or block_level with a cuda::std::extents object to describe dimensions of a level in a thread hierarchy. This type is not intended to be created explicitly and *_dims functions creating them should be used instead. They will translate the input arguments to a correct cuda::std::extents to be stored inside level_dimensions. While this type can be used to access the stored dimensions, the main usage is to pass a number of level_dimensions objects to make_hierarchy function in order to create a hierarchy. This type does not store what the unit is for the stored dimensions, it is instead implied by the level below it in a hierarchy object. In case there is a need to store more information about a specific level, for example some library-specific information, this type can be derived from and the resulting type can be used to build the hierarchy.

Snippet

#include <cudax/hierarchy_dimensions.cuh>

auto hierarchy = make_hierarchy(grid_dims(256), block_dims<8, 8, 8>());
assert(hierarchy.level(grid).dims.x == 256);

Template Parameters
  • Level – Type indicating which hierarchy level this is

  • Dimensions – Type holding the dimensions of this level

Public Types

using level_type = Level

Public Functions

inline constexpr level_dimensions(const Dimensions &d)
inline constexpr level_dimensions(Dimensions &&d)
inline constexpr level_dimensions()
inline constexpr bool operator==(const level_dimensions &left, const level_dimensions &right) noexcept
inline constexpr bool operator!=(const level_dimensions &left, const level_dimensions &right) noexcept

Public Members

const Dimensions dims