5#include "dynamic_subscript.hpp"
6#include "../numerical/numerical_type.hpp"
8#include "../platform/attributes.hpp"
9#include "../platform/dynamic_shared_object.h"
18class strided_layout_implementation;
228 std::shared_ptr<const strided_layout_implementation> m_implementation;
232 std::shared_ptr<const strided_layout_implementation>
impl
244struct hash<
rexlib::strided_layout>
246 std::size_t operator()(
250 return layout.hash();
#define REXLIB_NODISCARD
Indicates that the return value should be used.
Definition attributes.hpp:76
Container for multidimensional numeric data.
Definition array.hpp:31
Class describing a runtime defined subscript.
Definition dynamic_subscript.hpp:30
Represents a non-owning area of contiguous memory.
Definition span.hpp:99
Definition strided_layout.hpp:21
std::ptrdiff_t get_offset() const noexcept
Get the offset of the data.
REXLIB_NODISCARD strided_layout squeeze() const
Remove insignificant axes of the layout.
std::size_t hash() const noexcept
Obtain a hash of the layout.
REXLIB_NODISCARD strided_layout transpose() const
Reverse the order of the axes.
REXLIB_NODISCARD strided_layout apply_subscripts(span< const dynamic_subscript > subscripts) const
Apply a set of dynamic subscripts to this layout.
static strided_layout make_contiguous_layout(span< const std::size_t > extents)
Create a contiguous layout from the provided extents.
REXLIB_NODISCARD strided_layout broadcast_to(span< const std::size_t > extents) const
Perform a broadcast of the layout to match the provided extents.
REXLIB_NODISCARD strided_layout matrix_transpose(std::ptrdiff_t axis1=-1, std::ptrdiff_t axis2=-2) const
Swap two axes in the layout.
REXLIB_NODISCARD strided_layout permute(span< const std::size_t > order) const
Permute the order of the axes.
void get_extents(std::vector< std::size_t > &extents) const
Get the extents of the layout.
std::size_t get_rank() const noexcept
Get the number of axis in the layout.
const strided_layout_implementation & get_implementation() const noexcept
Get the implementation of this layout.
std::size_t compute_element_count() const noexcept
Computes the number of elements referenced by the layout.
void get_strides(std::vector< std::ptrdiff_t > &strides) const
Get the strides of the layout.
bool extents_equal(span< const std::size_t > extents) const noexcept
Check if this layout has a specific shape.
REXLIB_NODISCARD strided_layout matrix_diagonal(std::ptrdiff_t axis1=-1, std::ptrdiff_t axis2=-2) const
Obtains a layout view to the matrix diagonal defined by two axes.
std::size_t compute_storage_requirement() const noexcept
Computes the minimum storage size (in elements) for this layout.
Arrays, the operations on them and the devices that run those operations.
Definition cpu_device.hpp:10