rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
Loading...
Searching...
No Matches
joint_layout.hpp
1// SPDX-License-Identifier: GPL-3.0-only
2
3#pragma once
4
5#include "joint_cursor.hpp"
6#include "../span.hpp"
7#include "../platform/dynamic_shared_object.h"
8
9#include <memory>
10
11namespace rexlib
12{
13
14class joint_layout_implementation;
15
30{
31public:
36 static REXLIB_CONST_CONSTEXPR std::size_t end_dim =
37 std::numeric_limits<std::size_t>::max();
38
40 REXLIB_API explicit joint_layout(
41 std::unique_ptr<
44 );
45 joint_layout(const joint_layout&) = delete;
49
51 operator=(const joint_layout&) = delete;
53 operator=(joint_layout&& other) noexcept;
54
61
68
75
88
101
113
127 std::size_t iter(
129 std::size_t first_dim = 0,
130 std::size_t last_dim = end_dim
131 ) const;
132
159 std::size_t seek(
161 std::size_t position,
162 std::size_t first_dim = 0,
163 std::size_t last_dim = end_dim
164 ) const;
165
189 std::size_t next(
191 std::size_t n,
192 std::size_t first_dim = 0,
193 std::size_t last_dim = end_dim
194
195 ) const noexcept;
196
208
209private:
210 std::unique_ptr<
212 > m_implementation;
213};
214
215} // namespace rexlib
Container for multidimensional numeric data.
Definition array.hpp:31
Traversal state (indices and per-operand offsets) of a joint_layout.
Definition joint_cursor.hpp:17
Provides joint access semantics for multiple operands.
Definition joint_layout.hpp:30
std::ptrdiff_t get_offset(std::size_t operand) const
Get the offset parameter of an operand.
std::size_t compute_element_count() const noexcept
Computes the number of positions the iteration space holds.
static REXLIB_CONST_CONSTEXPR std::size_t end_dim
Definition joint_layout.hpp:36
std::size_t seek(joint_cursor &ite, std::size_t position, std::size_t first_dim=0, std::size_t last_dim=end_dim) const
Populate a cursor for traversing this layout, positioned at a given point of the traversal.
std::size_t get_number_of_operands() const noexcept
Get the number of operands.
const joint_layout_implementation * get_implementation() const noexcept
Get a pointer to the implementation.
std::size_t iter(joint_cursor &ite, std::size_t first_dim=0, std::size_t last_dim=end_dim) const
Populate a cursor for traversing this layout.
std::size_t next(joint_cursor &ite, std::size_t n, std::size_t first_dim=0, std::size_t last_dim=end_dim) const noexcept
Advance a cursor.
span< const std::size_t > get_extents() const
Get the extents of the iteration space.
span< const std::ptrdiff_t > get_strides(std::size_t operand) const
Get the strides for an operand.
std::size_t get_rank() const noexcept
Get the number of dimensions.
Represents a non-owning area of contiguous memory.
Definition span.hpp:99
Arrays, the operations on them and the devices that run those operations.
Definition cpu_device.hpp:10