rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
Loading...
Searching...
No Matches
creation.hpp
1// SPDX-License-Identifier: GPL-3.0-only
2
3#pragma once
4
5#include <rexlib/core/ndarray/array.hpp>
6#include <rexlib/core/ndarray/const_array_ref.hpp>
7
8#include <rexlib/core/numerical/numerical_type.hpp>
9#include <rexlib/core/numerical/scalar_value.hpp>
10#include <rexlib/core/hardware/memory_resource_affinity.hpp>
11
12#include <cstddef>
13
14namespace rexlib
15{
16
17class execution_context;
18
19
30REXLIB_API
35 array *out = nullptr
36);
37
53 array *out = nullptr
54);
55
71 array *out = nullptr
72);
73
91 array *out = nullptr
92);
93
123 const scalar_value &start,
124 const scalar_value &stop,
125 const scalar_value &step,
129 array *out = nullptr
130);
131
146 const scalar_value &start,
147 const scalar_value &stop,
151 array *out = nullptr
152);
153
167 const scalar_value &stop,
171 array *out = nullptr
172);
173
196 const scalar_value &start,
197 const scalar_value &stop,
198 std::size_t count,
202 array *out = nullptr
203);
204
224 const scalar_value &start,
225 const scalar_value &stop,
226 std::size_t count,
227 bool endpoint,
231 array *out = nullptr
232);
233
244 const_array_ref source,
246 array *out = nullptr
247);
248
257void fill(
258 array &out,
261);
262
263} // namespace rexlib
Description of the memory representation of a multidimensional array.
Definition array_descriptor.hpp:22
Container for multidimensional numeric data.
Definition array.hpp:31
Non-owning read-only reference to an array.
Definition const_array_ref.hpp:36
Pairs the hardware resources and the dispatch strategy used to run operations.
Definition execution_context.hpp:43
Owns a copy of a dynamically typed scalar value.
Definition scalar_value.hpp:35
Arrays, the operations on them and the devices that run those operations.
Definition cpu_device.hpp:10
array zeros(array_descriptor descriptor, memory_resource_affinity affinity, const execution_context &context, array *out=nullptr)
Create an array with all its elements set to zero.
array ones(array_descriptor descriptor, memory_resource_affinity affinity, const execution_context &context, array *out=nullptr)
Create an array with all its elements set to one.
void fill(array &out, const scalar_value &fill_value, const execution_context &context)
Set all the elements of an array to a given value.
memory_resource_affinity
Enumeration to query memory_resource according to its intended usage.
Definition memory_resource_affinity.hpp:12
array full(array_descriptor descriptor, memory_resource_affinity affinity, const scalar_value &fill_value, const execution_context &context, array *out=nullptr)
Create an array with all its elements set to a given value.
array linspace(const scalar_value &start, const scalar_value &stop, std::size_t count, numerical_type data_type, memory_resource_affinity affinity, const execution_context &context, array *out=nullptr)
Create a one dimensional array of evenly spaced samples.
array empty(array_descriptor descriptor, memory_resource_affinity affinity, const execution_context &context, array *out=nullptr)
Create an array without initializing its elements.
array copy(const_array_ref source, const execution_context &context, array *out=nullptr)
Create an array as a copy of an existing one.
numerical_type
Representation of all considered numerical types for computations.
Definition numerical_type.hpp:19
array arange(const scalar_value &start, const scalar_value &stop, const scalar_value &step, numerical_type data_type, memory_resource_affinity affinity, const execution_context &context, array *out=nullptr)
Create a one dimensional array holding an arithmetic progression.