cuda::experimental::places::cute_sub_shape#

template<size_t rank>
class cute_sub_shape#

The set of element coordinates one place owns, as iterated by parallel_for.

Produced by cute_partition_descriptor::apply(): enumerates the place’s local mode and converts each local index to global tensor coordinates. This runtime fallback uses fixed-capacity storage; typed C++ partitions produce static_cute_sub_shape instead.

Public Types

using coords_t = ::cuda::std::array<size_t, rank>#

Public Functions

inline cute_sub_shape(
::cuda::std::span<const layout_leaf> local_leaves,
size_t offset,
dim4 padded_dims,
const ::cuda::std::array<size_t, rank> &lo,
const ::cuda::std::array<size_t, rank> &hi
)#
Parameters:
  • local_leaves – Local mode of the place (leaf 0 fastest)

  • offset – Linear element offset of the place’s first element

  • padded_dims – Padded tensor extents the strides refer to

  • lo – Inclusive per-dimension lower bounds of the iterated region

  • hi – Exclusive per-dimension upper bounds of the iterated region; coordinates outside [lo, hi) are skipped by the parallel_for loops (predication: interior regions and padding phantoms alike)

inline bool contains(const coords_t &coords) const#

Whether the given coordinates are within the iterated region.

inline size_t size() const#

Number of elements this place owns.

inline coords_t index_to_coords(size_t index) const#

Global tensor coordinates of the place’s index-th element.