rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
rexlib::joint_layout_builder Class Reference

Factory class to obtain instances of array_access_layout. More...

#include <rexlib/core/layout/joint_layout_builder.hpp>

Public Member Functions

 joint_layout_builder (const joint_layout_builder &)=delete
 
 joint_layout_builder (joint_layout_builder &&other) noexcept
 
joint_layout_builder & operator= (const joint_layout_builder &)=delete
 
joint_layout_builder & operator= (joint_layout_builder &&other) noexcept
 
joint_layout_builder & set_extents (span< const std::size_t > extents)
 Set the extents of the iteration space.
 
joint_layout_builder & add_operand (const strided_layout &layout)
 Add an operand to the layout.
 
joint_layout_builder & add_operand (span< const std::size_t > extents, span< const std::ptrdiff_t > strides, std::ptrdiff_t offset)
 Add an operand to the layout.
 
joint_layout build (joint_layout_build_flags flags=default_flags)
 Build the joint_layout from the operands contained in this builder.
 
const joint_layout_implementation * get_implementation () const noexcept
 Get a pointer to the implementation.
 

Static Public Attributes

static REXLIB_CONST_CONSTEXPR joint_layout_build_flags default_flags
 

Detailed Description

Factory class to obtain instances of array_access_layout.

See also
array_access_layout

Member Function Documentation

◆ add_operand() [1/2]

joint_layout_builder & rexlib::joint_layout_builder::add_operand ( const strided_layout &  layout)

Add an operand to the layout.

If set_extents has not been called, the first call to this method will set the extents of the operand as the extents of the iteration space.

When the iteration space extents are defined, the provided layout must be broadcastable to these extents.

Parameters
layoutLayout of the operand.
Returns
joint_layout_builder& A reference to *this.

◆ add_operand() [2/2]

joint_layout_builder & rexlib::joint_layout_builder::add_operand ( span< const std::size_t >  extents,
span< const std::ptrdiff_t >  strides,
std::ptrdiff_t  offset 
)

Add an operand to the layout.

If set_extents has not been called, the first call to this method will set the extents of the operand as the extents of the iteration space.

When the iteration space extents are defined, the provided layout must be broadcastable to these extents.

Parameters
extentsThe extents of the operand.
stridesThe strides of the operand
offsetThe offset of the operand.
Returns
joint_layout_builder& A reference to *this.

◆ build()

joint_layout rexlib::joint_layout_builder::build ( joint_layout_build_flags  flags = default_flags)

Build the joint_layout from the operands contained in this builder.

The building process can apply certain optimizations to the joint layout which can be controlled though the flags parameter.

Parameters
flagsFlags controlling the optimizations applied to the joint layout. By default, all optimizations are enabled.
Returns
joint_layout The newly built joint_layout.

◆ get_implementation()

const joint_layout_implementation * rexlib::joint_layout_builder::get_implementation ( ) const
noexcept

Get a pointer to the implementation.

Returns
const joint_layout_implementation* Pointer to the implementation.
Note
This method is meant to be used for testing purposes, as the joint_layout_implementation is not publicly available.

◆ set_extents()

joint_layout_builder & rexlib::joint_layout_builder::set_extents ( span< const std::size_t >  extents)

Set the extents of the iteration space.

Parameters
extentsExtents of the iteration space.
Returns
joint_layout_builder& A reference to *this.
Exceptions
std::logic_errorIf the extents were already set, or an operand was already added.
Note
This method can only be called once at most for each layout creation and it must be called before any call to add_operand.

Member Data Documentation

◆ default_flags

REXLIB_CONST_CONSTEXPR joint_layout_build_flags rexlib::joint_layout_builder::default_flags
static

The documentation for this class was generated from the following file: