Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
Classes | Namespaces | Typedefs | Functions
zip_layout.hpp File Reference

Additional layout helpers and policies for zipped mdspan views. More...

#include <uni20/core/compiler_attributes.hpp>
#include <uni20/mdspan/concepts.hpp>
#include <uni20/mdspan/mdspan.hpp>
#include <algorithm>
#include <array>
#include <cassert>
#include <cstddef>
#include <initializer_list>
#include <tuple>
#include <type_traits>
#include <utility>
Include dependency graph for zip_layout.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  uni20::GeneralZipLayout< Layouts >
 Fallback zip layout for arbitrary mapping policies. More...
 
struct  uni20::GeneralZipLayout< Layouts >::mapping< Extents >
 
struct  uni20::StridedZipLayout< NumSpans >
 Zip layout for NumSpans strided spans (all using layout_stride). More...
 
struct  uni20::StridedZipLayout< NumSpans >::mapping< Ext >
 Nested mapping policy for extents Ext, modeling LayoutMappingPolicy. More...
 
struct  uni20::zip_layout_selector< Spans >
 Picks the right zip layout for a pack of mdspan types. More...
 
struct  uni20::zip_layout_selector< Spans... >
 Specialization that selects StridedZipLayout when all spans are strided. More...
 

Namespaces

namespace  uni20
 

Typedefs

template<typename... Spans>
using uni20::common_extents_t = typename detail::common_extents< Spans... >::type
 Convenience alias that represents the common extents of a set of mdspans.
 
template<typename T , std::size_t N>
using uni20::tuple_n = decltype(detail::make_tuple_n_impl< T >(std::make_index_sequence< N >{}))
 Alias: tuple_n<T,N> is std::tuple<T,T,…> with N repetitions of T.
 
template<typename... Spans>
using uni20::zip_layout_t = typename zip_layout_selector< Spans... >::type
 Alias to extract the chosen layout policy for the given spans.
 

Functions

template<typename T , std::size_t N>
UNI20_HOST_DEVICE constexpr std::array< T, N+1 > uni20::concat (const std::array< T, N > &a, const T &x)
 Append a single element to the end of an array.
 
template<typename T , std::size_t N1, std::size_t N2>
UNI20_HOST_DEVICE constexpr std::array< T, N1+N2 > uni20::concat (const std::array< T, N1 > &a1, const std::array< T, N2 > &a2)
 Concatenate two std::array instances into one (constexpr helper).
 
template<typename T , std::size_t N>
UNI20_HOST_DEVICE constexpr std::array< T, N+1 > uni20::concat (const T &x, const std::array< T, N > &a)
 Prepend a single element in front of an array.
 
template<typename... Spans>
auto uni20::make_common_extents (Spans... spans)
 Build an extents object representing the common shape of the given spans.
 

Detailed Description

Additional layout helpers and policies for zipped mdspan views.