cuda::hierarchy_level_desc#

template<class _Level, class _Exts>
class hierarchy_level_desc : private __hierarchy_level_desc_base#

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 hierarchy_level_desc. While this type can be used to access the stored dimensions, the main usage is to pass a number of hierarchy_level_desc 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#
using extents_type = _Exts#

Public Functions

constexpr hierarchy_level_desc() noexcept = default#
inline constexpr hierarchy_level_desc(const _Exts &__exts) noexcept#
inline constexpr _Exts extents() const noexcept#

Friends

inline friend constexpr bool operator==(
const hierarchy_level_desc &__lhs,
const hierarchy_level_desc &__rhs
) noexcept#
inline friend constexpr bool operator!=(
const hierarchy_level_desc &__lhs,
const hierarchy_level_desc &__rhs
) noexcept#