47 for (
rank_type axis = 0; axis < extents_type::rank(); ++axis)
49 if (extents_.extent(axis) == 0)
return 0;
50 result *= extents_.extent(axis);
56 template <
class... Indices>
57 requires(
sizeof...(Indices) == extents_type::rank() && (std::is_convertible_v<Indices, index_type> && ...))
62 for (
rank_type axis = 0; axis < extents_type::rank(); ++axis)
63 offset = offset * extents_.extent(axis) + logical[axis];
Definition generated_layout.hpp:24
typename extents_type::size_type size_type
Definition generated_layout.hpp:29
typename extents_type::rank_type rank_type
Definition generated_layout.hpp:30
UNI20_HOST_DEVICE constexpr auto required_span_size() const noexcept -> index_type
Return the number of synthetic offsets in the logical index space.
Definition generated_layout.hpp:44
UNI20_HOST_DEVICE constexpr mapping(extents_type const &extents) noexcept
Construct a synthetic mapping over the supplied logical extents.
Definition generated_layout.hpp:35
UNI20_HOST_DEVICE constexpr bool is_strided() const noexcept
Definition generated_layout.hpp:72
UNI20_HOST_DEVICE constexpr bool is_unique() const noexcept
Definition generated_layout.hpp:70
static UNI20_HOST_DEVICE constexpr bool is_always_strided() noexcept
Definition generated_layout.hpp:69
UNI20_HOST_DEVICE constexpr mapping()=default
UNI20_HOST_DEVICE constexpr auto extents() const noexcept -> extents_type const &
Return the generated value's logical extents.
Definition generated_layout.hpp:38
Extents extents_type
Definition generated_layout.hpp:27
typename extents_type::index_type index_type
Definition generated_layout.hpp:28
UNI20_HOST_DEVICE constexpr bool is_exhaustive() const noexcept
Definition generated_layout.hpp:71
friend UNI20_HOST_DEVICE constexpr bool operator==(mapping const &, mapping const &)=default
static UNI20_HOST_DEVICE constexpr bool is_always_unique() noexcept
Definition generated_layout.hpp:67
static UNI20_HOST_DEVICE constexpr bool is_always_exhaustive() noexcept
Definition generated_layout.hpp:68
Project compiler annotations shared by host and device code.
#define UNI20_HOST_DEVICE
Definition compiler_attributes.hpp:12
Definition async/async.hpp:26
Synthetic non-strided layout used by generated tensor accessors.
Definition generated_layout.hpp:23