Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
uni20::StridedZipLayout< NumSpans >::mapping< Ext > Struct Template Reference

Nested mapping policy for extents Ext, modeling LayoutMappingPolicy. More...

#include <zip_layout.hpp>

Public Types

using extents_type = Ext
 multidimensional shape
 
using index_type = typename Ext::index_type
 
using layout_type = StridedZipLayout
 back-link to policy
 
using mapping_type = mapping< Ext >
 
using offset_type = tuple_n< index_type, NumSpans >
 
using rank_type = typename Ext::rank_type
 

Public Member Functions

UNI20_HOST_DEVICE std::array< std::array< index_type, Ext::rank()>, num_spans > const & all_strides () const noexcept
 Retrieve the 2-D array of all per-span strides.
 
UNI20_HOST_DEVICE constexpr extents_type const & extents () const noexcept
 Return the extents of the layout.
 
UNI20_HOST_DEVICE constexpr bool is_exhaustive () const noexcept
 Never exhaustive at runtime.
 
UNI20_HOST_DEVICE constexpr bool is_strided () const noexcept
 True if every dimension uses the same stride across all spans.
 
UNI20_HOST_DEVICE constexpr bool is_unique () const noexcept
 Always unique at runtime.
 
template<typename... Mappings>
UNI20_HOST_DEVICE constexpr mapping (extents_type const &exts, Mappings... maps) noexcept
 Construct from extents and existing child mappings.
 
UNI20_HOST_DEVICE constexpr mapping (extents_type const &exts, std::array< std::array< index_type, Ext::rank()>, NumSpans > const &strides_pack) noexcept
 Construct from shared extents and per-span raw strides.
 
template<typename LeftMap , typename RightMap >
requires (LeftMap::num_spans + RightMap::num_spans == num_spans)
UNI20_HOST_DEVICE constexpr mapping (LeftMap const &left, RightMap const &right) noexcept
 Merge two sub-mappings whose span counts sum to NumSpans.
 
template<typename OtherExt >
UNI20_HOST_DEVICE constexpr mapping (std::array< index_type, Ext::rank()> const &new_strides, typename StridedZipLayout< num_spans - 1 >::template mapping< OtherExt > const &other) noexcept
 Prepend one span’s strides before an existing mapping of N–1 spans.
 
template<typename OtherExt >
UNI20_HOST_DEVICE constexpr mapping (typename StridedZipLayout< num_spans - 1 >::template mapping< OtherExt > const &other, std::array< index_type, Ext::rank()> const &new_strides) noexcept
 Append one span’s strides after an existing mapping of N–1 spans.
 
template<typename... Idx>
UNI20_HOST_DEVICE constexpr offset_type operator() (Idx... idxs) const noexcept
 Compute per-span linear offsets for a multi-index.
 
UNI20_HOST_DEVICE constexpr index_type stride (rank_type r) const noexcept
 Return the common stride in dimension r.
 
UNI20_HOST_DEVICE constexpr std::array< index_type, Ext::rank()> strides () const noexcept
 Return the common strides for each dimension.
 

Static Public Member Functions

static UNI20_HOST_DEVICE constexpr bool is_always_exhaustive () noexcept
 Never exhaustive: no single contiguous backing buffer.
 
static UNI20_HOST_DEVICE constexpr bool is_always_strided () noexcept
 Statically unknown if strided: may differ per dimension.
 
static UNI20_HOST_DEVICE constexpr bool is_always_unique () noexcept
 Always unique for uni20 tensors.
 

Static Public Attributes

static constexpr std::size_t num_spans = NumSpans
 Number of spans in this zip layout.
 

Detailed Description

template<std::size_t NumSpans>
template<typename Ext>
struct uni20::StridedZipLayout< NumSpans >::mapping< Ext >

Nested mapping policy for extents Ext, modeling LayoutMappingPolicy.

Template Parameters
ExtExtents type managed by the mapping.

Member Typedef Documentation

◆ extents_type

template<std::size_t NumSpans>
template<typename Ext >
using uni20::StridedZipLayout< NumSpans >::mapping< Ext >::extents_type = Ext

multidimensional shape

◆ index_type

template<std::size_t NumSpans>
template<typename Ext >
using uni20::StridedZipLayout< NumSpans >::mapping< Ext >::index_type = typename Ext::index_type

◆ layout_type

template<std::size_t NumSpans>
template<typename Ext >
using uni20::StridedZipLayout< NumSpans >::mapping< Ext >::layout_type = StridedZipLayout

back-link to policy

◆ mapping_type

template<std::size_t NumSpans>
template<typename Ext >
using uni20::StridedZipLayout< NumSpans >::mapping< Ext >::mapping_type = mapping<Ext>

◆ offset_type

template<std::size_t NumSpans>
template<typename Ext >
using uni20::StridedZipLayout< NumSpans >::mapping< Ext >::offset_type = tuple_n<index_type, NumSpans>

◆ rank_type

template<std::size_t NumSpans>
template<typename Ext >
using uni20::StridedZipLayout< NumSpans >::mapping< Ext >::rank_type = typename Ext::rank_type

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