7#include <batmat/config.hpp>
8#include <guanaqo/mat-view.hpp>
18template <
class IntConst>
19 requires requires {
typename IntConst::value_type; }
21 using type =
typename IntConst::value_type;
43template <
class I = index_t,
class S = std::
integral_constant<I, 1>,
class D = I,
44 class L = DefaultStr
ide, StorageOrder O = StorageOrder::ColMajor>
58 }, std::integral_constant<index_t, S::value>, index_t>;
97 const auto d =
static_cast<I
>(
depth);
98 return (d + bs - 1) / bs;
103 return n + (bs - n % bs) % bs;
119 if constexpr (std::is_same_v<layer_stride_type, DefaultStride>)
136 return s * (l - offset) + offset;
143 if constexpr (
requires { standard_stride_type::value; })
constexpr auto cols(const Matrix< T, I, S, D, O, A > &v)
typename integral_value_type< T >::type integral_value_type_t
constexpr auto data(Matrix< T, I, S, D, O, A > &v)
constexpr auto outer_stride(const Matrix< T, I, S, D, O, A > &v)
constexpr auto rows(const Matrix< T, I, S, D, O, A > &v)
typename IntConst::value_type type
constexpr auto depth(const Matrix< T, I, S, D, O, A > &v)
constexpr index_type num_batches() const
batch_size_type batch_size
constexpr Layout(PlainLayout p={})
constexpr index_type ceil_depth(index_type n) const
Round up the given size n to a multiple of batch_size.
T & operator()(T *data, index_type l, index_type r, index_type c) const
constexpr auto get_layer_stride() const
static standard_stride_type convert_to_standard_stride(auto s)
constexpr index_type floor_depth() const
Round down the depth to a multiple of batch_size.
layer_stride_type layer_stride
static constexpr bool is_column_major
constexpr index_type inner_size() const
static constexpr bool is_row_major
index_type size() const
Total number of elements in the view (excluding padding).
constexpr bool has_full_outer_stride() const
batch_size_type batch_size
constexpr index_type floor_depth(index_type n) const
Round down the given size n to a multiple of batch_size.
constexpr bool has_full_layer_stride() const
constexpr index_type layer_index(index_type l, index_type s) const
guanaqo::MatrixView< T, I, standard_stride_type, storage_order > operator()(T *data, index_type l) const
constexpr index_type layer_index(index_type l) const
constexpr index_type ceil_depth() const
Round up the depth to a multiple of batch_size.
static constexpr StorageOrder storage_order
std::conditional_t< requires { S::value; }, std::integral_constant< index_t, S::value >, index_t > standard_stride_type
index_type padded_size() const
constexpr bool has_full_inner_stride() const
layer_stride_type layer_stride
constexpr index_type outer_size() const