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 | List of all members
rexlib::array Class Reference

Container for multidimensional numeric data. More...

#include <rexlib/core/ndarray/array.hpp>

Public Member Functions

 array ()
 Construct an uninitialized array.
 
 array (std::shared_ptr< const array_implementation > implementation) noexcept
 Construct an array from a shared pointer to the implementation.
 
 array (std::shared_ptr< buffer > storage, array_descriptor descriptor)
 Construct an array from its components.
 
 array (const array &other)=delete
 
 array (array &&other) noexcept
 
array & operator= (const array &other)=delete
 
array & operator= (array &&other) noexcept
 
const array_descriptor & get_descriptor () const noexcept
 Get the descriptor of this array.
 
buffer * get_storage () noexcept
 Get the storage of this array.
 
const buffer * get_storage () const noexcept
 Get the storage of this array.
 
std::shared_ptr< buffer > share_storage () noexcept
 Get a shared pointer to the storage of this array.
 
std::shared_ptr< const buffer > share_storage () const noexcept
 Get the storage of this array.
 
array share () noexcept
 Obtain an alias for this array.
 
const_array share () const noexcept
 Obtain a read-only alias for this array.
 
const_array share_const () const noexcept
 Obtain a read-only alias for this array.
 
access_hazard_tracker * get_access_hazard_tracker () const noexcept
 Get the tracker of the commands that access the memory of this array.
 
const array_implementation * get_implementation () const noexcept
 Get a pointer to the implementation.
 

Detailed Description

Container for multidimensional numeric data.

This class allows to represent multidimensional numeric data in a hardware agnostic manner. It serves as a foundational basis to define interfaces that operate in such date. The array is represented as the (storage, descriptor) pair. The storage refers to an untyped region of memory (which may reside in accelerator hardware like GPUs). The descriptor defines the interpretation of that data to give raise to the notion of dimensions.

Constructor & Destructor Documentation

◆ array() [1/2]

rexlib::array::array ( std::shared_ptr< const array_implementation >  implementation)
explicitnoexcept

Construct an array from a shared pointer to the implementation.

Parameters
implementationThe implementation to be owned by this.
Note
This function is not part of the public API and shall only be used internally or for testing purposes.

◆ array() [2/2]

rexlib::array::array ( std::shared_ptr< buffer >  storage,
array_descriptor  descriptor 
)

Construct an array from its components.

Parameters
storageBuffer used to store the data contained in the array.
descriptorThe interpretation of the buffer memory.

Member Function Documentation

◆ get_access_hazard_tracker()

access_hazard_tracker * rexlib::array::get_access_hazard_tracker ( ) const
noexcept

Get the tracker of the commands that access the memory of this array.

Arrays obtained from one another share one tracker. Arrays built separately over the same storage do not.

Returns
access_hazard_tracker* The tracker. nullptr if the array is not initialized.

◆ get_descriptor()

const array_descriptor & rexlib::array::get_descriptor ( ) const
noexcept

Get the descriptor of this array.

Returns
array_descriptor The descriptor.

◆ get_implementation()

const array_implementation * rexlib::array::get_implementation ( ) const
noexcept

Get a pointer to the implementation.

Returns
const array_implementation* Pointer to the implementation. nullptr if the array is not initialized.
Note
This method is meant to be used internally and for testing purposes, as the array_implementation is not publicly available.

◆ get_storage() [1/2]

const buffer * rexlib::array::get_storage ( ) const
noexcept

Get the storage of this array.

Returns
const buffer* The storage. nullptr if the array is not initialized

◆ get_storage() [2/2]

buffer * rexlib::array::get_storage ( )
noexcept

Get the storage of this array.

Returns
buffer* The storage. nullptr if the array is not initialized.

◆ share() [1/2]

const_array rexlib::array::share ( ) const
noexcept

Obtain a read-only alias for this array.

Returns
const_array A const_array referencing the contents of this array.

◆ share() [2/2]

array rexlib::array::share ( )
noexcept

Obtain an alias for this array.

Returns
array Another array referencing the contents of this array.

◆ share_const()

const_array rexlib::array::share_const ( ) const
noexcept

Obtain a read-only alias for this array.

Equivalent to the const overload of share(). The distinct name makes the read-only result explicit when called on a mutable array.

Returns
const_array A const_array referencing the contents of this array.

◆ share_storage() [1/2]

std::shared_ptr< const buffer > rexlib::array::share_storage ( ) const
noexcept

Get the storage of this array.

Returns
std::shared_ptr<const buffer> The storage. nullptr if the array is not initialized

◆ share_storage() [2/2]

std::shared_ptr< buffer > rexlib::array::share_storage ( )
noexcept

Get a shared pointer to the storage of this array.

Returns
std::shared_ptr<buffer> The storage. nullptr if the array is not initialized.

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