|
rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
|
Arrays, the operations on them and the devices that run those operations. More...
Namespaces | |
| namespace | cpu |
| The backend that runs operations on the CPU of the host. | |
| namespace | em |
| Operations for CryoEM and CryoET image processing. | |
| namespace | ops |
| The declarations of the operations: their operands, parameters and rules. | |
Classes | |
| class | access_hazard_tracker |
| Tracks the commands that access a piece of memory. More... | |
| class | ambiguous_backend_error |
| Exception indicating that could not disambiguate among multiple backend candidates. More... | |
| struct | any_extent_domain |
| Domain admitting every extent. More... | |
| struct | any_type_domain |
| Named domain holding every representable type. More... | |
| class | array |
| Container for multidimensional numeric data. More... | |
| class | array_descriptor |
| Description of the memory representation of a multidimensional array. More... | |
| class | array_ref |
| Non-owning reference to an array. More... | |
| struct | axis_run |
| Leading core axes as many as the operation instance names. More... | |
| class | bad_dynamic_subscript_access |
| class | bad_scalar_value_access |
| Exception thrown when accessing a scalar_value with an incorrect type. More... | |
| class | basic_operation |
| CRTP base supplying the static description of an operation. More... | |
| class | broadcast_error |
| class | buffer |
| Represents an untyped memory allocation at a given memory resource. More... | |
| struct | category_type_domain |
| Named domain holding every type of a given category. More... | |
| class | command |
| Specification of work to be executed on a command_queue. More... | |
| class | command_queue |
| Abstract command queue belonging to a device. More... | |
| class | command_timeline |
| Tells the host which commands of a queue have finished. More... | |
| class | command_token |
| Identifies a command submitted to a command_queue. More... | |
| struct | complex_type_transform |
| Transform mapping a pivot type onto its complex counterpart. More... | |
| class | const_array |
| Read-only view into an array. More... | |
| class | const_array_ref |
| Non-owning read-only reference to an array. More... | |
| struct | core_dimensions |
| The core axes of one operand. More... | |
| class | core_dimensions_descriptor |
| Type erased form of a core_dimensions. More... | |
| struct | core_dimensions_descriptor_table |
| Lower the core axes of every operand of one kind into a table. More... | |
| struct | core_dimensions_descriptor_table< type_list< Cores... > > |
| struct | core_dimensions_descriptor_table< type_list<> > |
| class | device |
| Abstract representation of a hardware compute device. More... | |
| class | device_backend |
| Abstract class that represents a hardware backend. More... | |
| class | device_context |
| Scoped, configurable view over a device_session. More... | |
| class | device_index |
| Location of a device as a (backend, id) tuple. More... | |
| class | device_manager |
| Centralize multiple device_backend sessions and route device queries to the appropriate one. More... | |
| class | device_properties |
| Description of the static characteristics of a physical device visible from the host. More... | |
| class | device_session |
| Immutable aggregate of a device handle and its associated objects. More... | |
| class | dispatcher |
| Abstract interface that executes operations on a set of operands. More... | |
| struct | domain_difference |
| Named domain holding what one domain has and another lacks. More... | |
| struct | domain_intersection |
| Named domain holding the intersection of other named domains. More... | |
| struct | domain_union |
| Named domain holding the union of other named domains. More... | |
| class | dynamic_library |
| RAII style class to load, query and unload dynamic libraries. More... | |
| class | dynamic_subscript |
| Class describing a runtime defined subscript. More... | |
| struct | ellipsis_tag |
| Tag to express the consumption of an arbitrary amount of axes until no slack is left on the right-hand dimensions. More... | |
| class | execution_context |
| Pairs the hardware resources and the dispatch strategy used to run operations. More... | |
| class | extent_domain |
| Set of extents an axis may take. More... | |
| struct | extent_pivot |
| Declaration of one extent variable of a shape rule. More... | |
| class | extent_pivot_descriptor |
| Type erased form of an extent_pivot. More... | |
| struct | extent_pivot_descriptor_table |
| Lower the extent variables of a shape rule into a table. More... | |
| struct | extent_pivot_descriptor_table< type_list< Extents... > > |
| struct | extent_pivot_descriptor_table< type_list<> > |
| struct | extent_slot |
| Binding of one core axis to an extent variable through a transform. More... | |
| class | extent_slot_descriptor |
| Type erased form of an extent_slot. More... | |
| struct | extent_slot_descriptor_table |
| Lower the slots of one core into a table of descriptors. More... | |
| struct | extent_slot_descriptor_table< type_list< Slots... > > |
| struct | extent_slot_descriptor_table< type_list<> > |
| class | extent_transform |
| Type erased form of an extent transform. More... | |
| struct | fixed_extent |
| Accessor yielding a fixed extent, whatever the parameters. More... | |
| struct | fixed_type_transform |
| Transform ignoring the pivot and yielding a fixed type. More... | |
| class | flagset |
| Stores a set of bits in the form of flags Similar to std::bitset but instead of a index based interface it provides a enum based interface. More... | |
| class | float16_t |
| 16 bit floating point number representation. More... | |
| struct | inexact_type_transform |
| Transform mapping a pivot type onto its inexact counterpart. More... | |
| class | invalid_operation_error |
| Exception indicating that the function call is not available due to a misconfiguration of the class. More... | |
| struct | is_floating_point |
| Determine if a type is a floating point type. More... | |
| class | joint_cursor |
| Traversal state (indices and per-operand offsets) of a joint_layout. More... | |
| class | joint_layout |
| Provides joint access semantics for multiple operands. More... | |
| class | joint_layout_builder |
| Factory class to obtain instances of array_access_layout. More... | |
| class | memory_allocator |
| Abstract allocator of buffer objects on a memory_resource. More... | |
| class | memory_resource |
| Abstract description of a physical memory region. More... | |
| struct | named_core |
| Placement of the core axes where the operation instance names them. More... | |
| struct | named_domain |
| Base giving a named domain both of its halves. More... | |
| struct | native_type_of |
| Convert numerical_type-s to static types. More... | |
| struct | native_type_of< numerical_type::boolean > |
| struct | native_type_of< numerical_type::char8 > |
| struct | native_type_of< numerical_type::complex_float16 > |
| struct | native_type_of< numerical_type::complex_float32 > |
| struct | native_type_of< numerical_type::complex_float64 > |
| struct | native_type_of< numerical_type::float16 > |
| struct | native_type_of< numerical_type::float32 > |
| struct | native_type_of< numerical_type::float64 > |
| struct | native_type_of< numerical_type::int16 > |
| struct | native_type_of< numerical_type::int32 > |
| struct | native_type_of< numerical_type::int64 > |
| struct | native_type_of< numerical_type::int8 > |
| struct | native_type_of< numerical_type::uint16 > |
| struct | native_type_of< numerical_type::uint32 > |
| struct | native_type_of< numerical_type::uint64 > |
| struct | native_type_of< numerical_type::uint8 > |
| struct | new_axis_tag |
| Tag to express the creation a new axis of size one. More... | |
| class | no_parameters |
| Parameters of an operation that takes none. More... | |
| class | numerical_type_domain |
| Set of numerical_type-s. More... | |
| struct | numerical_type_of |
| Convert static types to numerical_type. More... | |
| struct | numerical_type_of< bool > |
| struct | numerical_type_of< char > |
| struct | numerical_type_of< float16_t > |
| struct | numerical_type_of< float32_t > |
| struct | numerical_type_of< float64_t > |
| struct | numerical_type_of< std::complex< float16_t > > |
| struct | numerical_type_of< std::complex< float32_t > > |
| struct | numerical_type_of< std::complex< float64_t > > |
| struct | numerical_type_of< std::int16_t > |
| struct | numerical_type_of< std::int32_t > |
| struct | numerical_type_of< std::int64_t > |
| struct | numerical_type_of< std::int8_t > |
| struct | numerical_type_of< std::uint16_t > |
| struct | numerical_type_of< std::uint32_t > |
| struct | numerical_type_of< std::uint64_t > |
| struct | numerical_type_of< std::uint8_t > |
| class | operand_descriptor |
| Logical representation of an operand's properties. More... | |
| struct | operand_names |
| Compile time list of operand names. More... | |
| struct | operand_names_count |
| Get the operand count of an operand name list. More... | |
| struct | operand_shape_rule |
| Declarative shape rule for the operands of an operation. More... | |
| class | operand_specification |
| Shape and data type of an operand. More... | |
| struct | operand_type_rule |
| Declarative typing rule for the operands of an operation. More... | |
| class | operation |
| Abstract class that describes an operation. More... | |
| class | operation_arity |
| Describes the operand count of an operation. More... | |
| class | operation_descriptor |
| Immutable static description of an operation type. More... | |
| class | operation_id |
| Unique identification for an operation type. More... | |
| class | operation_signature |
| Interface deciding the shape and data type of the operands of an operation. More... | |
| class | parametric_operation |
| CRTP base for operations whose signature depends on parameters. More... | |
| class | plugin |
| Abstract class representing a plugin interface. More... | |
| class | plugin_load_error |
| Exception indicating that an error occurred when loading a plugin. More... | |
| class | plugin_manager |
| Class managing a set of plugins. More... | |
| struct | positive_extent_domain |
| Domain admitting every extent but zero. More... | |
| class | program |
| Abstract representation of an executable program. More... | |
| class | program_builder |
| Abstract representation of a factory class for operation programs. More... | |
| class | program_builder_registration |
Appends a factory for Builder to a registry upon construction. More... | |
| class | program_builder_registry |
| Collects program_builder factories for bulk registration into a program_manager. More... | |
| class | program_cache |
| Bounded associative store for backend-private resources reused across operation program builds. More... | |
| class | program_cache_key |
| Abstract base for keys stored in an program_cache. More... | |
| class | program_manager |
| Centralizes all known instances of operation program builders. More... | |
| class | program_scratch_requirement |
| Describes a scratch buffer requirement for program execution. More... | |
| struct | real_type_transform |
| Transform mapping a pivot type onto its real counterpart. More... | |
| struct | repeated_type_list |
Utility class to obtain a type_list with a type repeated a fixed number of times. More... | |
| struct | repeated_type_list< T, 0 > |
| class | rule_signature |
| Operation signature made of a shape rule and a typing rule. More... | |
| struct | same_extent_transform |
| Transform mapping an extent onto itself. More... | |
| struct | same_type_transform |
| Transform mapping a pivot type onto itself. More... | |
| class | scalar_value |
| Owns a copy of a dynamically typed scalar value. More... | |
| class | service_catalog |
| Stores a single instance of each type service_manager. More... | |
| class | service_manager |
| Abstract class defining the interface of a service manager. More... | |
| struct | shape_rule_accessors |
| Read the values a shape rule depends on from the parameters of an operation instance. More... | |
| class | shape_rule_descriptor |
| Type erased form of an operand_shape_rule. More... | |
| struct | shape_rule_descriptor_of |
| Lower a shape rule into its descriptor. More... | |
| class | shape_rule_interpreter |
| Interpreter of a shape rule lowered to tables. More... | |
| struct | shared_rule_signature |
| The signature of every operation that takes no parameters and follows a given pair of rules. More... | |
| struct | single_type_domain |
| Named domain holding a single type. More... | |
| class | slice |
| Class representing an slice of an array. More... | |
| class | span |
| Represents a non-owning area of contiguous memory. More... | |
| class | strided_layout |
| struct | trailing_core |
| Placement of the core axes at the end of every operand. More... | |
| class | trivial_operation |
| CRTP base for operations that are trivially declared. More... | |
| struct | type_list |
| Helper class to pass a heterogeneous sequence of types to a function. More... | |
| struct | type_list_cat |
Utility class to concatenate an arbitrary number of type_list-s. More... | |
| struct | type_list_cat< type_list< As... >, type_list< Bs... >, Rest... > |
| struct | type_list_cat< type_list< Ts... > > |
| struct | type_list_element |
Utility class to index a type on a type_list. More... | |
| struct | type_list_element< 0, type_list< Head, Tail... > > |
| struct | type_list_element< I, type_list< Head, Tail... > > |
| struct | type_list_prepend |
Utility class to prepend a type to the front of a type_list. More... | |
| struct | type_list_prepend< T, type_list< Ts... > > |
| struct | type_list_size |
Utility class to obtain the size of a type_list. More... | |
| struct | type_list_size< type_list< Ts... > > |
| struct | type_pivot |
| Declaration of one free variable of a typing rule. More... | |
| class | type_pivot_descriptor |
| Type erased form of a type_pivot. More... | |
| struct | type_pivot_descriptor_table |
| Lower a rule's pivot list into a table of descriptors. More... | |
| struct | type_pivot_descriptor_table< type_list< Pivots... > > |
| struct | type_pivot_descriptor_table< type_list<> > |
| struct | type_rule_accessors |
| Read the data types a typing rule depends on from the parameters of an operation instance. More... | |
| class | type_rule_descriptor |
| Type erased form of an operand_type_rule. More... | |
| struct | type_rule_descriptor_of |
| Lower a type rule into a descriptor. More... | |
| class | type_rule_interpreter |
| Interpreter of a typing rule lowered to a descriptor. More... | |
| struct | type_rule_operand_types |
| Apply the transform of every slot to the type of its pivot. More... | |
| struct | type_rule_operand_types< type_list< Slots... >, type_list< Pivots... > > |
| struct | type_rule_pivots_in_domain |
| Check that each pivot type lies in the domain its pivot declares. More... | |
| struct | type_rule_pivots_in_domain< type_list< Pivot, Pivots... >, type_list< Type, Types... > > |
| struct | type_rule_pivots_in_domain< type_list<>, type_list<> > |
| class | type_rule_resolution |
| Resolved pivot values of a typing rule, or the reason it failed. More... | |
| struct | type_slot |
| Binding of one operand to a pivot through a transform. More... | |
| class | type_slot_descriptor |
| Type erased form of a type_slot. More... | |
| struct | type_slot_descriptor_table |
| Lower a rule's slot list into a table of descriptors. More... | |
| struct | type_slot_descriptor_table< type_list< Slots... > > |
| struct | type_slot_descriptor_table< type_list<> > |
| class | type_tag |
| Helper class to pass type information to a function. More... | |
| class | type_transform |
| Type erased form of a type transform. More... | |
| class | typed_program_cache_key |
| Default key wrapper for value types that model std::hash and equality comparison. More... | |
| class | unsupported_capability_error |
| Exception indicating that an object lacks a capability a call requires. More... | |
| class | unsupported_operation_error |
| Exception indicating that nothing available can carry out a requested operation. More... | |
| class | version |
Typedefs | |
| using | program_builder_factory = std::unique_ptr< program_builder >(*)() |
| Factory function that creates a fresh program_builder instance. | |
| using | joint_layout_build_flags = flagset< joint_layout_build_flag_bits > |
| Set of joint_layout_build_flag_bits used to control the joint_layout build behavior. | |
| template<typename... Lists> | |
| using | type_list_cat_t = typename type_list_cat< Lists... >::type |
Convenience alias for type_list_cat<Lists...>::type. | |
| using | float32_t = float |
| 32 bit floating point number representation. | |
| using | float64_t = double |
| 64 bit floating point number representation. | |
| using | boolean_type_domain = category_type_domain< numerical_type_category::boolean > |
| using | character_type_domain = category_type_domain< numerical_type_category::character > |
| using | signed_integer_type_domain = category_type_domain< numerical_type_category::signed_integer > |
| using | unsigned_integer_type_domain = category_type_domain< numerical_type_category::unsigned_integer > |
| using | floating_point_type_domain = category_type_domain< numerical_type_category::floating_point > |
| using | complex_type_domain = category_type_domain< numerical_type_category::complex > |
| using | integral_type_domain = domain_union< signed_integer_type_domain, unsigned_integer_type_domain > |
| Signed and unsigned integers. | |
| using | inexact_type_domain = domain_union< floating_point_type_domain, complex_type_domain > |
| Floating point and complex types, i.e. those with a fractional part. | |
| using | real_arithmetic_type_domain = domain_union< integral_type_domain, floating_point_type_domain > |
| Integers and floating point types, i.e. arithmetic types on the real line. | |
| using | arithmetic_type_domain = domain_union< integral_type_domain, inexact_type_domain > |
| Every type arithmetic operations are defined on. | |
| using | signed_arithmetic_type_domain = domain_union< signed_integer_type_domain, inexact_type_domain > |
| Arithmetic types that can represent a negative value. | |
| template<typename Domain = any_extent_domain> | |
| using | extent_from_inputs = extent_pivot< extent_pivot_source::inputs, void, Domain > |
| Extent variable bound by the input axes that name it. | |
| template<typename Accessor , typename Domain = any_extent_domain> | |
| using | extent_from_operation = extent_pivot< extent_pivot_source::operation, Accessor, Domain > |
| Extent variable supplied by the operation instance. | |
| template<std::size_t N> | |
| using | extent_fixed = extent_pivot< extent_pivot_source::fixed, fixed_extent< N >, any_extent_domain > |
| Extent variable fixed by the declaration of the operation. | |
| template<std::size_t E> | |
| using | axis_same_as = extent_slot< E, same_extent_transform > |
| Axis of the extent of an extent variable. | |
| template<std::size_t I, typename Domain = any_type_domain> | |
| using | pivot_from_input = type_pivot< type_pivot_source::input, I, Domain > |
| Pivot fixed by the data type of an input operand. | |
| template<std::size_t I, typename Domain = any_type_domain, std::ptrdiff_t DefaultPivot = -1> | |
| using | pivot_from_output = type_pivot< type_pivot_source::output, I, Domain, DefaultPivot > |
| Free pivot, adopted from a user supplied output operand. | |
| template<typename Accessor , typename Domain = any_type_domain> | |
| using | pivot_from_operation = type_pivot< type_pivot_source::operation, 0, Domain, -1, Accessor > |
| Pivot supplied by the operation instance. | |
| template<typename Slots , typename Pivots > | |
| using | type_rule_operand_types_t = typename type_rule_operand_types< Slots, Pivots >::type |
Convenience alias for type_rule_operand_types<Slots, Pivots>::type. | |
| template<std::size_t I = 0> | |
| using | slot_same_as = type_slot< I, same_type_transform > |
| Slot whose operand has the pivot type itself. | |
| template<std::size_t I = 0> | |
| using | slot_real_of = type_slot< I, real_type_transform > |
| Slot whose operand has the real counterpart of the pivot type. | |
| template<std::size_t I = 0> | |
| using | slot_complex_of = type_slot< I, complex_type_transform > |
| Slot whose operand has the complex counterpart of the pivot type. | |
| template<std::size_t I = 0> | |
| using | slot_inexact_of = type_slot< I, inexact_type_transform > |
| Slot whose operand has the inexact counterpart of the pivot type. | |
| template<numerical_type Type, std::size_t I = 0> | |
| using | slot_fixed = type_slot< I, fixed_type_transform< Type > > |
| Slot whose operand has a fixed type, whatever the pivot is. | |
| using | access_flags = flagset< access_flag_bits > |
Enumerations | |
| enum class | backend_priority { unsupported = std::numeric_limits<int>::min() , fallback = -1024 , normal = 0 , optimal = 1024 } |
| Enumeration defining the preference over the selection of a particular backend. More... | |
| enum class | device_type { unknown = -1 , cpu , gpu , integrated_gpu } |
| Broad classification of compute devices. More... | |
| enum class | memory_resource_affinity { host , device , count } |
| Enumeration to query memory_resource according to its intended usage. More... | |
| enum class | memory_resource_kind { unified , managed , device_local , device_mapped , host_staging , host } |
| Describes the nature of a memory resource. More... | |
| enum class | joint_layout_build_flag_bits { enable_reordering = bit(0) , enable_coalescing = bit(1) } |
| Flags to control the behavior of the joint_layout build behavior. More... | |
| enum class | byte : uint8_t |
| A byte of memory. More... | |
| enum class | numerical_type { unknown = -1 , boolean , char8 , int8 , uint8 , int16 , uint16 , int32 , uint32 , int64 , uint64 , float16 , float32 , float64 , complex_float16 , complex_float32 , complex_float64 , count } |
| Representation of all considered numerical types for computations. | |
| enum class | numerical_type_category { unknown = -1 , boolean , character , signed_integer , unsigned_integer , floating_point , complex , count } |
Broad categorical classification of numerical_type. More... | |
| enum class | core_placement { trailing , named } |
| Where the core axes of the operands lie. More... | |
| enum class | extent_pivot_source { inputs , operation , fixed } |
| Origin of the value of a shape rule extent variable. More... | |
| enum class | output_batch { exact , broadcast_target , accumulated } |
| Which batch axes an output supplied in advance may have. More... | |
| enum class | type_pivot_source { input , output , operation } |
| Origin of the value of a typing rule pivot. More... | |
| enum class | type_rule_status { ok , invalid_type , domain_violation , undefined_transform , slot_mismatch , unresolved_pivot , operand_count_mismatch } |
| Outcome of resolving a typing rule against concrete operand types. More... | |
| enum class | access_flag_bits { read = bit(0) , write = bit(1) } |
Functions | |
| REXLIB_CONSTEXPR bool | operator< (backend_priority lhs, backend_priority rhs) noexcept |
| REXLIB_CONSTEXPR bool | operator<= (backend_priority lhs, backend_priority rhs) noexcept |
| REXLIB_CONSTEXPR bool | operator> (backend_priority lhs, backend_priority rhs) noexcept |
| REXLIB_CONSTEXPR bool | operator>= (backend_priority lhs, backend_priority rhs) noexcept |
| REXLIB_CONSTEXPR const char * | to_string (backend_priority priority) noexcept |
| template<typename T > | |
| std::basic_ostream< T > & | operator<< (std::basic_ostream< T > &os, backend_priority priority) |
| REXLIB_NODISCARD REXLIB_CONSTEXPR std::size_t | bit (std::size_t i) noexcept |
| Returns a std::size_t type with a single bit set at the provided index. | |
| template<typename T > | |
| REXLIB_NODISCARD REXLIB_CONSTEXPR std::enable_if< std::is_unsigned< T >::value, T >::type | bit_range_mask (std::size_t start, std::size_t end) noexcept |
| template<typename T > | |
| REXLIB_CONSTEXPR std::enable_if< std::is_unsigned< T >::value, T & >::type | set_lowest_zero_inplace (T &x) noexcept |
| Sets the lowest '0' bit to '1' in place. | |
| template<typename T > | |
| REXLIB_CONSTEXPR std::enable_if< std::is_unsigned< T >::value, T & >::type | clear_lowest_one_inplace (T &x) noexcept |
| Sets the lowest '1' bit to '0' in place. | |
| template<typename T > | |
| REXLIB_NODISCARD REXLIB_CONSTEXPR std::enable_if< std::is_unsigned< T >::value, T >::type | mask_trailing_zeros (T x) noexcept |
| Returns a mask for all the consecutive trailing '0'-s of the input word. | |
| template<typename T > | |
| REXLIB_NODISCARD REXLIB_CONSTEXPR std::enable_if< std::is_unsigned< T >::value, T >::type | mask_trailing_ones (T x) noexcept |
| Returns a mask for all the consecutive trailing '1'-s of the input word. | |
| template<typename T > | |
| REXLIB_NODISCARD REXLIB_CONSTEXPR std::enable_if< std::is_unsigned< T >::value, T >::type | rotate_left (T x, int s) noexcept |
| Returns the input word with a bitwise rotation towards the left. | |
| template<typename T > | |
| REXLIB_NODISCARD REXLIB_CONSTEXPR std::enable_if< std::is_unsigned< T >::value, T >::type | rotate_right (T x, int s) noexcept |
| Returns the input word with a bitwise rotation towards the right. | |
| template<typename T > | |
| REXLIB_NODISCARD REXLIB_CONSTEXPR std::enable_if< std::is_unsigned< T >::value, bool >::type | has_single_bit (T x) noexcept |
| Checks if the input word has one and only one bit set to '1'. | |
| template<typename T > | |
| REXLIB_NODISCARD REXLIB_CONSTEXPR std::enable_if< std::is_unsigned< T >::value, T >::type | bit_floor (T x) noexcept |
| Returns the largest power of 2 not greater than the input word. | |
| template<typename T > | |
| REXLIB_NODISCARD REXLIB_CONSTEXPR std::enable_if< std::is_unsigned< T >::value, T >::type | bit_ceil (T x) noexcept |
| Returns the smallest power of 2 not less than the input word. | |
| template<typename T > | |
| REXLIB_NODISCARD REXLIB_CONSTEXPR std::enable_if< std::is_unsigned< T >::value, int >::type | bit_width (T x) noexcept |
| Returns the number of bits required to represent the input number. | |
| template<typename T > | |
| REXLIB_NODISCARD REXLIB_CONSTEXPR std::enable_if< std::is_unsigned< T >::value, int >::type | count_leading_zeros (T x) noexcept |
| Counts the number of consecutive '0's from the MSB. | |
| template<typename T > | |
| REXLIB_NODISCARD REXLIB_CONSTEXPR std::enable_if< std::is_unsigned< T >::value, int >::type | count_leading_ones (T x) noexcept |
| Counts the number of consecutive '1's from the MSB. | |
| template<typename T > | |
| REXLIB_CONSTEXPR std::enable_if< std::is_unsigned< T >::value, int >::type | count_trailing_zeros (T x) noexcept |
| Counts the number of consecutive '0's from the LSB. | |
| template<typename T > | |
| REXLIB_NODISCARD REXLIB_CONSTEXPR std::enable_if< std::is_unsigned< T >::value, int >::type | count_trailing_ones (T x) noexcept |
| Counts the number of consecutive '1's from the LSB. | |
| template<typename T > | |
| REXLIB_NODISCARD REXLIB_CONSTEXPR std::enable_if< std::is_unsigned< T >::value, int >::type | popcount (T x) noexcept |
| Counts the number '1's in the input word. | |
| template<typename T > | |
| REXLIB_NODISCARD REXLIB_CONSTEXPR std::enable_if< std::is_unsigned< T >::value, bool >::type | parity (T x) noexcept |
| Computes the parity of the input word. | |
| std::shared_ptr< dispatcher > | make_eager_dispatcher (std::shared_ptr< const program_manager > program_manager) |
| Create a dispatcher that submits operations eagerly. | |
| void | execute (const operation &operation, span< array > output_operands, span< const const_array_ref > input_operands, const execution_context &context) |
| Execute a operation. | |
| array | execute (const operation &operation, span< const const_array_ref > input_operands, const execution_context &context, array *out=nullptr) |
| Execute a operation. | |
| array | execute_unary (const operation &operation, const const_array_ref &input, const execution_context &context, array *out=nullptr) |
| Execute an unary operation. | |
| void | execute_unary (const operation &operation, span< array > output_operands, const_array_ref input, const execution_context &context) |
| Execute an unary operation producing several outputs. | |
| array | execute_binary (const operation &operation, const_array_ref first_input, const_array_ref second_input, const execution_context &context, array *out=nullptr) |
| Execute an unary operation. | |
| void | execute_binary (const operation &operation, span< array > output_operands, const_array_ref first_input, const_array_ref second_input, const execution_context &context) |
| Execute a binary operation producing several outputs. | |
| array | execute_ternary (const operation &operation, const_array_ref first_input, const_array_ref second_input, const_array_ref third_input, const execution_context &context, array *out=nullptr) |
| Execute an unary operation. | |
| bool | parse_device_index (const std::string &text, device_index &result) |
| Parse the device ID from a string. | |
| const char * | to_string (device_type type) noexcept |
| const memory_resource & | get_host_memory_resource () noexcept |
| Get the resource representing host memory. | |
| int | score_host_affinity (memory_resource_kind kind) noexcept |
| Assign a numeric affinity score for host use to a memory kind. | |
| int | score_device_affinity (memory_resource_kind kind) noexcept |
| Assign a numeric affinity score for device use to a memory kind. | |
| bool | is_host_accessible (memory_resource_kind kind) noexcept |
| Check if the memory kind can be directly accessed from the host. | |
| bool | is_device_accessible (memory_resource_kind kind) noexcept |
| Check if the memory kind can be directly accessed from the device. | |
| void | broadcast_extents (std::vector< std::size_t > &extents1, std::vector< std::size_t > &extents2) |
| Perform a broadcast operation between two sets of extents. | |
| void | broadcast_extents_accumulate (std::vector< std::size_t > &result, span< const std::size_t > other) |
| Perform an cumulative extent broadcast step. | |
| bool | is_broadcast_compatible (span< const std::size_t > extents1, span< const std::size_t > extents2) noexcept |
| Check if two extents can be broadcasted together. | |
| bool | is_broadcastable_to (span< const std::size_t > from_extents, span< const std::size_t > to_extents) noexcept |
| Check if a set of extents can be broadcasted into another. | |
| template<typename F > | |
| REXLIB_CONSTEXPR auto | visit (F &&func, const dynamic_subscript &subscript) |
| Invoke the provided function with the value held by the dynamic subscript. | |
| std::size_t | sanitize_index (std::ptrdiff_t index, std::size_t extent) |
| Ensure that the index is within bounds for a given extent. | |
| REXLIB_CONSTEXPR const char * | to_string (joint_layout_build_flag_bits x) noexcept |
| template<typename T > | |
| std::basic_ostream< T > & | operator<< (std::basic_ostream< T > &os, joint_layout_build_flag_bits x) |
| REXLIB_CONSTEXPR std::size_t | end () noexcept |
| Get the value representing the end of an array to be used as count. | |
| REXLIB_CONSTEXPR slice | all () noexcept |
| Construct an slice containing all positions in the axis. | |
| REXLIB_CONSTEXPR slice | even () noexcept |
| Construct an slice containing even positions in the axis. | |
| REXLIB_CONSTEXPR slice | odd () noexcept |
| Construct an slice containing odd positions in the axis. | |
| REXLIB_CONSTEXPR slice | make_slice (std::size_t count) noexcept |
| Create an slice using its count value. | |
| REXLIB_CONSTEXPR slice | make_slice (std::ptrdiff_t start, std::size_t count) noexcept |
| Create an slice using its start and count values. | |
| REXLIB_CONSTEXPR slice | make_slice (std::ptrdiff_t start, std::size_t count, std::ptrdiff_t step) noexcept |
| Create an slice using its start and count values. | |
| slice | sanitize_slice (const slice &slice, std::size_t extent) |
| Sanitize a slice to ensure it is valid and within bounds for a given extent. | |
| REXLIB_CONSTEXPR ellipsis_tag | ellipsis () noexcept |
| Construct an ellipsis_tag. | |
| REXLIB_CONSTEXPR new_axis_tag | new_axis () noexcept |
| Construct a new_axis_tag. | |
| version | get_library_version () noexcept |
| Get the version of the rexlib installation. | |
| template<typename T > | |
| REXLIB_NODISCARD std::size_t | get_alignment (T *address) noexcept |
| Get the alignment of a pointer. | |
| REXLIB_NODISCARD REXLIB_CONSTEXPR std::size_t | get_alignment (std::uintptr_t address) noexcept |
| Get the alignment of an address. | |
| template<typename T > | |
| REXLIB_NODISCARD bool | is_aligned (T *address, std::size_t alignment) noexcept |
| Check if a pointer is aligned to the provided boundary. | |
| REXLIB_NODISCARD REXLIB_CONSTEXPR bool | is_aligned (std::uintptr_t address, std::size_t alignment) noexcept |
| Check if an address is aligned to the provided boundary. | |
| template<typename T > | |
| REXLIB_NODISCARD T * | align_floor (T *address, std::size_t alignment) noexcept |
| Align a pointer to a lower or equal address that satisfies the provided alignment. | |
| REXLIB_NODISCARD REXLIB_CONSTEXPR std::uintptr_t | align_floor (std::uintptr_t address, std::size_t alignment) noexcept |
| Align an address to a lower or equal address that satisfies the provided alignment. | |
| REXLIB_CONSTEXPR std::uintptr_t & | align_floor_inplace (std::uintptr_t &address, std::size_t alignment) noexcept |
| Align an address to a lower or equal address that satisfies the provided alignment. | |
| template<typename T > | |
| REXLIB_NODISCARD T * | align_ceil (T *address, std::size_t alignment) noexcept |
| Align a pointer to a higher or equal address that satisfies the provided alignment. | |
| REXLIB_NODISCARD REXLIB_CONSTEXPR std::uintptr_t | align_ceil (std::uintptr_t address, std::size_t alignment) noexcept |
| Align an address to a higher or equal address that satisfies the provided alignment. | |
| REXLIB_CONSTEXPR std::uintptr_t & | align_ceil_inplace (std::uintptr_t &address, std::size_t alignment) noexcept |
| Align an address to a higher or equal address that satisfies the provided alignment. | |
| template<typename T > | |
| REXLIB_NODISCARD T * | offset_bytes (T *address, std::ptrdiff_t count) |
| Offset an address by a given amount of bytes. | |
| void * | aligned_alloc (std::size_t size, std::size_t alignment) noexcept |
| Allocate memory with an alignment specification. | |
| void | aligned_free (void *ptr) noexcept |
| Release a memory block previously allocated with aligned_alloc. | |
| REXLIB_CONSTEXPR uint8_t | as_uint8 (byte b) noexcept |
| REXLIB_CONSTEXPR byte | as_byte (uint8_t b) noexcept |
| template<typename T > | |
| byte * | as_bytes (T *ptr) noexcept |
| View an object as the bytes it is stored in. | |
| template<typename T > | |
| const byte * | as_bytes (const T *ptr) noexcept |
| View an object as the bytes it is stored in. | |
| template<class IntegerType > | |
| REXLIB_CONSTEXPR byte | operator<< (byte b, IntegerType shift) noexcept |
| template<class IntegerType > | |
| REXLIB_CONSTEXPR byte | operator>> (byte b, IntegerType shift) noexcept |
| template<class IntegerType > | |
| REXLIB_CONSTEXPR byte & | operator<<= (byte &b, IntegerType shift) noexcept |
| template<class IntegerType > | |
| REXLIB_CONSTEXPR byte & | operator>>= (byte &b, IntegerType shift) noexcept |
| REXLIB_CONSTEXPR byte | operator~ (byte b) noexcept |
| REXLIB_CONSTEXPR byte | operator| (byte lhs, byte rhs) noexcept |
| REXLIB_CONSTEXPR byte | operator& (byte lhs, byte rhs) noexcept |
| REXLIB_CONSTEXPR byte | operator^ (byte lhs, byte rhs) noexcept |
| REXLIB_CONSTEXPR byte & | operator|= (byte &lhs, byte rhs) noexcept |
| REXLIB_CONSTEXPR byte & | operator&= (byte &lhs, byte rhs) noexcept |
| REXLIB_CONSTEXPR byte & | operator^= (byte &lhs, byte rhs) noexcept |
| REXLIB_CONSTEXPR std::size_t | get_byte_bits () noexcept |
| template<typename C > | |
| REXLIB_CONSTEXPR void | to_hex (byte b, C &high, C &low) noexcept |
| template<typename T > | |
| std::basic_ostream< T > & | operator<< (std::basic_ostream< T > &os, const byte &b) |
| array_descriptor | make_contiguous_array_descriptor (span< const std::size_t > extents, numerical_type data_type) |
| Create an array descriptor with a contiguous layout. | |
| bool | is_initialized (const array_descriptor &descriptor) noexcept |
| Check if the array descriptor is initialized. | |
| std::size_t | compute_storage_requirement (const array_descriptor &descriptor) |
| Compute the number of bytes required to store the given descriptor. | |
| void * | get_host_data (array_ref array) |
| Get where an array holds its values, on the host, to write them. | |
| const void * | get_host_data (const_array_ref array) |
| Get where an array holds its values, on the host, to read them. | |
| template<typename T , typename Q > | |
| REXLIB_NODISCARD T | numerical_cast (const Q &src) noexcept |
| Explicitly cast a numerical value from one type to another. | |
| std::size_t | get_size (numerical_type type) noexcept |
| Get the size of a numerical type. | |
| numerical_type | make_complex (numerical_type type) noexcept |
| Create a complex version, if exists. | |
| numerical_type | make_real (numerical_type type) noexcept |
| Get the real equivalent of a numerical type. | |
| numerical_type | make_inexact (numerical_type type) noexcept |
| Get the inexact equivalent of a numerical type. | |
| numerical_type | promote_types (numerical_type type1, numerical_type type2) noexcept |
| Get the common type of two numerical types. | |
| REXLIB_CONSTEXPR numerical_type_category | get_category (numerical_type type) noexcept |
| Get the category of the provided numerical type. | |
| const char * | to_string (numerical_type type) noexcept |
| const char * | to_string (numerical_type_category category) noexcept |
| std::ostream & | operator<< (std::ostream &os, numerical_type type) |
| std::ostream & | operator<< (std::ostream &os, numerical_type_category category) |
| template<typename F , typename... Types> | |
| REXLIB_CONSTEXPR auto | dispatch_numerical_types (F &&visitor, Types &&...types) |
| Dispatch a function with the numerical types. | |
| REXLIB_CONSTEXPR bool | is_domain_representable (numerical_type type) noexcept |
| Check whether a type has a bit representation within a domain. | |
| REXLIB_CONSTEXPR numerical_type_domain | operator~ (const numerical_type_domain &domain) noexcept |
| Compute the complement of a domain. | |
| REXLIB_CONSTEXPR_CPP14 numerical_type_domain | make_numerical_type_domain (numerical_type_category category) noexcept |
| Create the domain holding every type of a given category. | |
| template<typename Func > | |
| auto | visit (Func &&func, const scalar_value &value) |
| Access the value held by a scalar_value with its concrete type. | |
| template<typename T > | |
| T | scalar_value_cast (const scalar_value &value) |
| Convert the value held by a scalar_value into a concrete type. | |
| template<typename... Names> | |
| REXLIB_CONSTEXPR operand_names< sizeof...(Names)> | make_operand_names (Names... names) noexcept |
| Build an operand name list. | |
| REXLIB_NORETURN void | throw_unexpected_operation (const operation &got, const operation_descriptor &expected) |
| Report an operation that is not of the expected type. | |
| REXLIB_NORETURN void | throw_unexpected_operation (const operation &got, const char *expected) |
| Report an operation that is not of the expected type, which has no static description. | |
| template<typename Op > | |
| const Op & | operation_cast (const operation &op) |
| Downcast an operation after checking its identity. | |
| std::string | describe_operand (const operation_descriptor &descriptor, std::size_t index, bool output_operand) |
| Describe an operand for a diagnostic. | |
| template<std::size_t OutputCount, std::size_t InputCount> | |
| operation_descriptor | make_operation_descriptor (const char *component, const char *name, const operand_names< OutputCount > &outputs, const operand_names< InputCount > &inputs) noexcept |
| Build a descriptor from compile time operand name lists. | |
| template<typename Domain > | |
| extent_domain | make_extent_domain () noexcept |
| Build the domain an extent domain tag names. | |
| template<typename Transform > | |
| extent_transform | make_extent_transform () noexcept |
| Erase an extent transform tag. | |
| template<typename Op > | |
| type_rule_accessors< typenameOp::type_rule_type >::operation_data_type_array_type | get_operation_data_types (const Op &operation) noexcept |
| Get the data types an operation instance supplies to its typing rule. | |
| const char * | to_string (type_rule_status status) noexcept |
| Get a human readable representation of a rule status. | |
| template<typename Transform > | |
| type_transform | make_type_transform () noexcept |
| Erase a type transform tag. | |
| std::string | get_default_plugin_directory () |
| Get the default plugin directory. | |
| std::vector< std::string > | get_plugin_search_path () |
| Get the directories where plugins are searched for. | |
| void | discover_plugins (const std::string &directory, plugin_manager &manager) |
| Discover and load all plugins in a directory. | |
| void | discover_plugins (plugin_manager &manager) |
| Discover and load all plugins in the search path. | |
| std::size_t | register_all_plugins_at (const plugin_manager &manager, service_catalog &catalog) |
| Register all plugins from a plugin manager into an interface catalog. | |
| template<typename T > | |
| REXLIB_CONSTEXPR span< byte > | as_bytes (const span< T > &other) noexcept |
| template<typename T > | |
| REXLIB_CONSTEXPR span< const byte > | as_bytes (const span< const T > &other) noexcept |
| template<typename T , std::size_t N> | |
| REXLIB_CONSTEXPR span< byte, N *sizeof(T)> | as_bytes (const span< T, N > &other) noexcept |
| template<typename T , std::size_t N> | |
| REXLIB_CONSTEXPR span< const byte, N *sizeof(T)> | as_bytes (const span< const T, N > &other) noexcept |
| template<typename T > | |
| REXLIB_CONSTEXPR span< T > | make_span (T *ptr, std::size_t count) noexcept |
| template<typename T > | |
| REXLIB_CONSTEXPR span< const T > | make_span (const T *ptr, std::size_t count) noexcept |
| template<typename T , std::size_t N> | |
| REXLIB_CONSTEXPR span< T, N > | make_span (std::array< T, N > &array) noexcept |
| template<typename T , std::size_t N> | |
| REXLIB_CONSTEXPR span< const T, N > | make_span (const std::array< T, N > &array) noexcept |
| template<typename T > | |
| REXLIB_CONSTEXPR span< T > | make_span (std::vector< T > &array) noexcept |
| template<typename T > | |
| REXLIB_CONSTEXPR span< const T > | make_span (const std::vector< T > &array) noexcept |
| REXLIB_INLINE_CONST_CONSTEXPR access_flags | read_only (access_flag_bits::read) |
| REXLIB_INLINE_CONST_CONSTEXPR access_flags | write_only (access_flag_bits::write) |
| REXLIB_INLINE_CONST_CONSTEXPR access_flags | read_write ({access_flag_bits::read, access_flag_bits::write}) |
| REXLIB_CONSTEXPR const char * | to_string (access_flag_bits v) noexcept |
| template<typename T > | |
| std::basic_ostream< T > & | operator<< (std::basic_ostream< T > &os, access_flag_bits v) |
| void | swap (dynamic_library &lhs, dynamic_library &rhs) noexcept |
| Exchange two dynamic_library objects. | |
| std::string | get_hostname () |
| Get the hostname of the machine. | |
| std::size_t | get_total_system_memory () |
| Get the total memory available in the system. | |
| std::size_t | get_available_system_memory () |
| Get the memory available in the system. | |
| std::size_t | get_page_size () |
| Get the page size of the memory management subsystem. | |
| array | add (const_array_ref x, const_array_ref y, const execution_context &context, array *out=nullptr) |
| Compute the element-wise sum of two arrays. | |
| array | subtract (const_array_ref x, const_array_ref y, const execution_context &context, array *out=nullptr) |
| Compute the element-wise difference of two arrays. | |
| array | negate (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Compute the element-wise negation of an array. | |
| array | abs (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Compute the element-wise absolute value of an array. | |
| array | multiply (const_array_ref x, const_array_ref y, const execution_context &context, array *out=nullptr) |
| Compute the element-wise product of two arrays. | |
| array | divide (const_array_ref x, const_array_ref y, const execution_context &context, array *out=nullptr) |
| Compute the element-wise quotient of two arrays. | |
| array | modulo (const_array_ref x, const_array_ref y, const execution_context &context, array *out=nullptr) |
| Compute the element-wise modulo of two arrays. | |
| array | floor_divide (const_array_ref x, const_array_ref y, const execution_context &context, array *out=nullptr) |
| Compute the element-wise floor division of two arrays. | |
| array | sign (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Compute the element-wise sign of an array. | |
| std::pair< array, array > | divmod (const_array_ref x, const_array_ref y, const execution_context &context, array *quotient=nullptr, array *remainder=nullptr) |
| Compute the element-wise quotient and remainder of two arrays. | |
| array | bitwise_and (const_array_ref x, const_array_ref y, const execution_context &context, array *out=nullptr) |
| Compute the element-wise bitwise conjunction of two arrays. | |
| array | bitwise_or (const_array_ref x, const_array_ref y, const execution_context &context, array *out=nullptr) |
| Compute the element-wise bitwise disjunction of two arrays. | |
| array | bitwise_xor (const_array_ref x, const_array_ref y, const execution_context &context, array *out=nullptr) |
| Compute the element-wise bitwise exclusive disjunction of two arrays. | |
| array | bitwise_not (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Invert the bits of every element of an array. | |
| array | left_shift (const_array_ref x, const_array_ref y, const execution_context &context, array *out=nullptr) |
| Shift the bits of an array leftwards. | |
| array | right_shift (const_array_ref x, const_array_ref y, const execution_context &context, array *out=nullptr) |
| Shift the bits of an array rightwards. | |
| array | cast (array &input, numerical_type target_type, const execution_context &context) |
| Cast an array to a given numerical type. | |
| array | cast_copy (const_array_ref input, numerical_type target_type, const execution_context &context, array *out=nullptr) |
| Cast an array to a given numerical type into a new array. | |
| array | equal (const_array_ref x, const_array_ref y, const execution_context &context, array *out=nullptr) |
| Test element-wise whether one array is equal to another. | |
| array | not_equal (const_array_ref x, const_array_ref y, const execution_context &context, array *out=nullptr) |
| Test element-wise whether one array is different from another. | |
| array | less (const_array_ref x, const_array_ref y, const execution_context &context, array *out=nullptr) |
| Test element-wise whether one array is less than another. | |
| array | less_equal (const_array_ref x, const_array_ref y, const execution_context &context, array *out=nullptr) |
| Test element-wise whether one array is less than or equal to another. | |
| array | greater (const_array_ref x, const_array_ref y, const execution_context &context, array *out=nullptr) |
| Test element-wise whether one array is greater than another. | |
| array | greater_equal (const_array_ref x, const_array_ref y, const execution_context &context, array *out=nullptr) |
| Test element-wise whether one array is greater than or equal to another. | |
| array | real (array &x) |
| Obtain a view of the real part of an array. | |
| array | imag (array &x) |
| Obtain a view of the imaginary part of an array. | |
| array | conjugate (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Compute the element-wise conjugate of an array. | |
| array | angle (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Compute the element-wise argument of an array. | |
| array | empty (array_descriptor descriptor, memory_resource_affinity affinity, const execution_context &context, array *out=nullptr) |
| Create an array without initializing its elements. | |
| 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. | |
| 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 | 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. | |
| array | arange (const scalar_value &start, const scalar_value &stop, numerical_type data_type, memory_resource_affinity affinity, const execution_context &context, array *out=nullptr) |
| Create a one dimensional array counting from start to stop by one. | |
| array | arange (const scalar_value &stop, numerical_type data_type, memory_resource_affinity affinity, const execution_context &context, array *out=nullptr) |
| Create a one dimensional array counting from zero to stop by one. | |
| 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 | linspace (const scalar_value &start, const scalar_value &stop, std::size_t count, bool endpoint, 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 | copy (const_array_ref source, const execution_context &context, array *out=nullptr) |
| Create an array as a copy of an existing 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. | |
| array | fft (const_array_ref x, span< const std::ptrdiff_t > axes, ops::fourier_normalization normalization, const execution_context &context, array *out=nullptr) |
| Transform an array to the frequency domain. | |
| array | fft (const_array_ref x, span< const std::ptrdiff_t > axes, const execution_context &context, array *out=nullptr) |
| Transform an array to the frequency domain. | |
| array | fft (const_array_ref x, ops::fourier_normalization normalization, const execution_context &context, array *out=nullptr) |
| Transform an array to the frequency domain. | |
| array | fft (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Transform an array to the frequency domain. | |
| array | fft2 (const_array_ref x, ops::fourier_normalization normalization, const execution_context &context, array *out=nullptr) |
| Transform an array to the frequency domain. | |
| array | fft2 (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Transform an array to the frequency domain. | |
| array | fft3 (const_array_ref x, ops::fourier_normalization normalization, const execution_context &context, array *out=nullptr) |
| Transform an array to the frequency domain. | |
| array | fft3 (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Transform an array to the frequency domain. | |
| array | ifft (const_array_ref x, span< const std::ptrdiff_t > axes, ops::fourier_normalization normalization, const execution_context &context, array *out=nullptr) |
| Transform an array back from the frequency domain. | |
| array | ifft (const_array_ref x, span< const std::ptrdiff_t > axes, const execution_context &context, array *out=nullptr) |
| Transform an array back from the frequency domain. | |
| array | ifft (const_array_ref x, ops::fourier_normalization normalization, const execution_context &context, array *out=nullptr) |
| Transform an array back from the frequency domain. | |
| array | ifft (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Transform an array back from the frequency domain. | |
| array | ifft2 (const_array_ref x, ops::fourier_normalization normalization, const execution_context &context, array *out=nullptr) |
| Transform an array back from the frequency domain. | |
| array | ifft2 (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Transform an array back from the frequency domain. | |
| array | ifft3 (const_array_ref x, ops::fourier_normalization normalization, const execution_context &context, array *out=nullptr) |
| Transform an array back from the frequency domain. | |
| array | ifft3 (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Transform an array back from the frequency domain. | |
| array | rfft (const_array_ref x, span< const std::ptrdiff_t > axes, ops::fourier_normalization normalization, const execution_context &context, array *out=nullptr) |
| Transform a real array to the frequency domain. | |
| array | rfft (const_array_ref x, span< const std::ptrdiff_t > axes, const execution_context &context, array *out=nullptr) |
| Transform a real array to the frequency domain. | |
| array | rfft (const_array_ref x, ops::fourier_normalization normalization, const execution_context &context, array *out=nullptr) |
| Transform a real array to the frequency domain. | |
| array | rfft (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Transform a real array to the frequency domain. | |
| array | rfft2 (const_array_ref x, ops::fourier_normalization normalization, const execution_context &context, array *out=nullptr) |
| Transform a real array to the frequency domain. | |
| array | rfft2 (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Transform a real array to the frequency domain. | |
| array | rfft3 (const_array_ref x, ops::fourier_normalization normalization, const execution_context &context, array *out=nullptr) |
| Transform a real array to the frequency domain. | |
| array | rfft3 (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Transform a real array to the frequency domain. | |
| array | irfft (const_array_ref x, span< const std::ptrdiff_t > axes, std::size_t extent, ops::fourier_normalization normalization, const execution_context &context, array *out=nullptr) |
| Transform a half spectrum back into a real array. | |
| array | irfft (const_array_ref x, span< const std::ptrdiff_t > axes, std::size_t extent, const execution_context &context, array *out=nullptr) |
| Transform a half spectrum back into a real array. | |
| array | irfft (const_array_ref x, std::size_t extent, ops::fourier_normalization normalization, const execution_context &context, array *out=nullptr) |
| Transform a half spectrum back into a real array. | |
| array | irfft (const_array_ref x, std::size_t extent, const execution_context &context, array *out=nullptr) |
| Transform a half spectrum back into a real array. | |
| array | irfft2 (const_array_ref x, std::size_t extent, ops::fourier_normalization normalization, const execution_context &context, array *out=nullptr) |
| Transform a half spectrum back into a real array. | |
| array | irfft2 (const_array_ref x, std::size_t extent, const execution_context &context, array *out=nullptr) |
| Transform a half spectrum back into a real array. | |
| array | irfft3 (const_array_ref x, std::size_t extent, ops::fourier_normalization normalization, const execution_context &context, array *out=nullptr) |
| Transform a half spectrum back into a real array. | |
| array | irfft3 (const_array_ref x, std::size_t extent, const execution_context &context, array *out=nullptr) |
| Transform a half spectrum back into a real array. | |
| array | fftshift (const_array_ref x, span< const std::ptrdiff_t > axes, const execution_context &context, array *out=nullptr) |
| Move the zero frequency of a spectrum to its centre. | |
| array | fftshift (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Move the zero frequency of a spectrum to its centre. | |
| array | ifftshift (const_array_ref x, span< const std::ptrdiff_t > axes, const execution_context &context, array *out=nullptr) |
| Move the zero frequency of a spectrum back to its origin. | |
| array | ifftshift (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Move the zero frequency of a spectrum back to its origin. | |
| array | matmul (const_array_ref x, const_array_ref y, const execution_context &context, array *out=nullptr) |
| Multiply two arrays as stacks of matrices. | |
| array | matvec (const_array_ref x, const_array_ref y, const execution_context &context, array *out=nullptr) |
| Multiply a stack of matrices by a stack of vectors. | |
| array | vecmat (const_array_ref x, const_array_ref y, const execution_context &context, array *out=nullptr) |
| Multiply a stack of vectors by a stack of matrices. | |
| array | vecdot (const_array_ref x, const_array_ref y, std::ptrdiff_t axis, const execution_context &context, array *out=nullptr) |
| Contract two arrays along one axis, broadcasting the rest. | |
| array | vecdot (const_array_ref x, const_array_ref y, const execution_context &context, array *out=nullptr) |
| Contract two arrays along their last axis. | |
| array | cross (const_array_ref x, const_array_ref y, std::ptrdiff_t axis, const execution_context &context, array *out=nullptr) |
| Take the cross product of two arrays along one axis. | |
| array | cross (const_array_ref x, const_array_ref y, const execution_context &context, array *out=nullptr) |
| Take the cross product of two arrays along their last axis. | |
| array | logical_and (const_array_ref x, const_array_ref y, const execution_context &context, array *out=nullptr) |
| Compute the element-wise conjunction of two arrays. | |
| array | logical_or (const_array_ref x, const_array_ref y, const execution_context &context, array *out=nullptr) |
| Compute the element-wise disjunction of two arrays. | |
| array | logical_xor (const_array_ref x, const_array_ref y, const execution_context &context, array *out=nullptr) |
| Compute the element-wise exclusive disjunction of two arrays. | |
| array | logical_not (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Compute the element-wise negation of an array. | |
| array | is_nan (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Test element-wise whether an array holds values that are not numbers. | |
| array | is_inf (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Test element-wise whether an array holds infinite values. | |
| array | is_finite (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Test element-wise whether an array holds finite values. | |
| array | sign_bit (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Test element-wise whether the sign bit of an array is set. | |
| array | copysign (const_array_ref x, const_array_ref y, const execution_context &context, array *out=nullptr) |
| Compose an array from the magnitude of one and the sign of another. | |
| array | power (const_array_ref x, const_array_ref y, const execution_context &context, array *out=nullptr) |
| Raise the elements of an array to the power of another. | |
| array | square (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Compute the element-wise square of an array. | |
| array | reciprocal (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Compute the element-wise reciprocal of an array. | |
| array | sqrt (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Compute the element-wise square root of an array. | |
| array | cbrt (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Compute the element-wise cube root of an array. | |
| array | exp (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Compute the element-wise exponential of an array. | |
| array | exp2 (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Compute the element-wise base two exponential of an array. | |
| array | expm1 (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Compute the element-wise exponential of an array, minus one. | |
| array | log (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Compute the element-wise natural logarithm of an array. | |
| array | log2 (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Compute the element-wise base two logarithm of an array. | |
| array | log10 (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Compute the element-wise base ten logarithm of an array. | |
| array | log1p (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Compute the element-wise natural logarithm of one plus an array. | |
| array | make_key (std::uint64_t seed, const execution_context &context, array *out=nullptr) |
| Create a key from a seed. | |
| std::uint64_t | entropy_seed () |
| Draw a seed from the entropy source of the system. | |
| array | fold_in_key (const_array_ref key, const_array_ref data, const execution_context &context, array *out=nullptr) |
| Derive keys from keys and values. | |
| array | split_key (const_array_ref key, std::size_t count, const execution_context &context, array *out=nullptr) |
| Derive a sequence of keys from every key. | |
| array | sum (const_array_ref x, span< const std::ptrdiff_t > axes, bool keep_dimensions, const execution_context &context, array *out=nullptr) |
| Sum the elements of an array along the given axes. | |
| array | sum (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Sum the elements of an array over every axis. | |
| array | product (const_array_ref x, span< const std::ptrdiff_t > axes, bool keep_dimensions, const execution_context &context, array *out=nullptr) |
| Multiply the elements of an array along the given axes. | |
| array | product (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Multiply the elements of an array over every axis. | |
| array | amin (const_array_ref x, span< const std::ptrdiff_t > axes, bool keep_dimensions, const execution_context &context, array *out=nullptr) |
| Take the smallest elements of an array along the given axes. | |
| array | amin (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Take the smallest elements of an array over every axis. | |
| array | amax (const_array_ref x, span< const std::ptrdiff_t > axes, bool keep_dimensions, const execution_context &context, array *out=nullptr) |
| Take the largest elements of an array along the given axes. | |
| array | amax (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Take the largest elements of an array over every axis. | |
| array | all (const_array_ref x, span< const std::ptrdiff_t > axes, bool keep_dimensions, const execution_context &context, array *out=nullptr) |
| Test whether every element along the given axes is true. | |
| array | all (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Test whether every element over every axis is true. | |
| array | any (const_array_ref x, span< const std::ptrdiff_t > axes, bool keep_dimensions, const execution_context &context, array *out=nullptr) |
| Test whether any element along the given axes is true. | |
| array | any (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Test whether any element over every axis is true. | |
| array | argmin (const_array_ref x, span< const std::ptrdiff_t > axes, bool keep_dimensions, const execution_context &context, array *out=nullptr) |
| Locate the smallest elements of an array along the given axes. | |
| array | argmin (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Locate the smallest elements of an array over every axis. | |
| array | argmax (const_array_ref x, span< const std::ptrdiff_t > axes, bool keep_dimensions, const execution_context &context, array *out=nullptr) |
| Locate the largest elements of an array along the given axes. | |
| array | argmax (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Locate the largest elements of an array over every axis. | |
| array | count_nonzero (const_array_ref x, span< const std::ptrdiff_t > axes, bool keep_dimensions, const execution_context &context, array *out=nullptr) |
| Count the non zero elements along the given axes. | |
| array | count_nonzero (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Count the non zero elements over every axis. | |
| array | mean (const_array_ref x, span< const std::ptrdiff_t > axes, bool keep_dimensions, const execution_context &context, array *out=nullptr) |
| Average the elements of an array along the given axes. | |
| array | mean (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Average the elements of an array over every axis. | |
| array | floor (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Round the elements of an array downwards. | |
| array | ceil (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Round the elements of an array upwards. | |
| array | trunc (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Round the elements of an array towards zero. | |
| array | round (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Round the elements of an array to the nearest integer. | |
| array | where (const_array_ref condition, const_array_ref x, const_array_ref y, const execution_context &context, array *out=nullptr) |
| Select element-wise between two arrays according to a condition. | |
| array | clip (const_array_ref x, const_array_ref lower, const_array_ref upper, const execution_context &context, array *out=nullptr) |
| Confine the elements of an array to an interval. | |
| array | maximum (const_array_ref x, const_array_ref y, const execution_context &context, array *out=nullptr) |
| Take the element-wise maximum of two arrays. | |
| array | minimum (const_array_ref x, const_array_ref y, const execution_context &context, array *out=nullptr) |
| Take the element-wise minimum of two arrays. | |
| array | transfer (array &input, memory_resource_affinity affinity, const execution_context &context) |
| Transfer an array to memory with the requested affinity. | |
| array | transfer_copy (const_array_ref input, memory_resource_affinity affinity, const execution_context &context, array *out=nullptr) |
| Transfer an array to memory with the requested affinity enforcing a copy. | |
| array | to_device (array &input, const execution_context &context) |
| Transfer an array from host to device memory. | |
| array | to_device_copy (const_array_ref input, const execution_context &context, array *out=nullptr) |
| Transfer an array to device memory enforcing a copy. | |
| array | to_host (array &input, const execution_context &context) |
| Transfer an array to host accessible memory. | |
| array | to_host_copy (const_array_ref input, const execution_context &context, array *out=nullptr) |
| Transfer an array to host accessible memory enforcing a copy. | |
| array | sin (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Compute the element-wise sine of an array. | |
| array | cos (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Compute the element-wise cosine of an array. | |
| array | tan (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Compute the element-wise tangent of an array. | |
| array | asin (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Compute the element-wise arc sine of an array. | |
| array | acos (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Compute the element-wise arc cosine of an array. | |
| array | atan (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Compute the element-wise arc tangent of an array. | |
| array | sinh (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Compute the element-wise hyperbolic sine of an array. | |
| array | cosh (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Compute the element-wise hyperbolic cosine of an array. | |
| array | tanh (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Compute the element-wise hyperbolic tangent of an array. | |
| array | asinh (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Compute the element-wise inverse hyperbolic sine of an array. | |
| array | acosh (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Compute the element-wise inverse hyperbolic cosine of an array. | |
| array | atanh (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Compute the element-wise inverse hyperbolic tangent of an array. | |
| array | atan2 (const_array_ref y, const_array_ref x, const execution_context &context, array *out=nullptr) |
| Compute the element-wise arc tangent of two arrays, by quadrant. | |
| array | hypot (const_array_ref x, const_array_ref y, const execution_context &context, array *out=nullptr) |
| Compute the element-wise hypotenuse of two arrays. | |
| array | degrees (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Convert an array from radians to degrees. | |
| array | radians (const_array_ref x, const execution_context &context, array *out=nullptr) |
| Convert an array from degrees to radians. | |
| std::pair< array, array > | sincos (const_array_ref x, const execution_context &context, array *sine=nullptr, array *cosine=nullptr) |
| Compute the element-wise sine and cosine of an array at once. | |
| array | subarray (array &input, span< const dynamic_subscript > subscripts) |
| Obtain a view of a rectangular part of an array. | |
| const_array | subarray (const_array_ref input, span< const dynamic_subscript > subscripts) |
| Obtain a read-only view of a rectangular part of an array. | |
Variables | |
| REXLIB_INLINE_CONST_CONSTEXPR std::size_t | max_extent_pivot_count = 8 |
| Maximum number of extent variables a shape rule may declare. | |
| REXLIB_INLINE_CONST_CONSTEXPR std::size_t | max_type_pivot_count = 8 |
| Maximum number of free variables a typing rule may declare. | |
| REXLIB_CONSTEXPR auto | dynamic_extent = std::numeric_limits<std::size_t>::max() |
| Constant representing dynamic size of an array. | |
Arrays, the operations on them and the devices that run those operations.
| using rexlib::axis_same_as = typedef extent_slot<E, same_extent_transform> |
Axis of the extent of an extent variable.
| E | Index of the extent variable. |
| using rexlib::extent_fixed = typedef extent_pivot< extent_pivot_source::fixed, fixed_extent<N>, any_extent_domain > |
Extent variable fixed by the declaration of the operation.
Models core axes of a fixed length, such as the three components of a cross product. The value reaches the interpreter with the extents the operation instance supplies, so a rule reading only fixed extents needs no parameters.
| N | The extent. |
Extent variable bound by the input axes that name it.
| Domain | Tag naming the admissible extents. |
| using rexlib::extent_from_operation = typedef extent_pivot<extent_pivot_source::operation, Accessor, Domain> |
Extent variable supplied by the operation instance.
Models operations that fix an extent by themselves, such as the length of a sequence.
| Accessor | Type reading the extent from the parameters of the operation instance. |
| Domain | Tag naming the admissible extents. |
Pivot fixed by the data type of an input operand.
| I | Index of the input operand. |
| Domain | Tag naming the admissible types. |
| using rexlib::pivot_from_operation = typedef type_pivot<type_pivot_source::operation, 0, Domain, -1, Accessor> |
Pivot supplied by the operation instance.
Models operations that carry a type as a parameter, such as a cast to a requested data type. The values the operation supplies are taken in the order the pivots that read them are declared.
| Accessor | Type reading the value from the parameters of the operation instance. |
| Domain | Tag naming the admissible types. |
| using rexlib::pivot_from_output = typedef type_pivot<type_pivot_source::output, I, Domain, DefaultPivot> |
Free pivot, adopted from a user supplied output operand.
| I | Index of the output operand. |
| Domain | Tag naming the admissible types. |
| DefaultPivot | Index of the pivot whose value is adopted when the user did not pre-allocate the output, or -1 to leave it unknown. |
| using rexlib::slot_complex_of = typedef type_slot<I, complex_type_transform> |
Slot whose operand has the complex counterpart of the pivot type.
| I | Index of the pivot. |
| using rexlib::slot_fixed = typedef type_slot<I, fixed_type_transform<Type> > |
Slot whose operand has a fixed type, whatever the pivot is.
| Type | The type of the operand. |
| I | Index of the pivot. Unused, but kept so that every slot names a pivot. |
| using rexlib::slot_inexact_of = typedef type_slot<I, inexact_type_transform> |
Slot whose operand has the inexact counterpart of the pivot type.
| I | Index of the pivot. |
| using rexlib::slot_real_of = typedef type_slot<I, real_type_transform> |
Slot whose operand has the real counterpart of the pivot type.
| I | Index of the pivot. |
| using rexlib::slot_same_as = typedef type_slot<I, same_type_transform> |
Slot whose operand has the pivot type itself.
| I | Index of the pivot. |
| using rexlib::type_list_cat_t = typedef typename type_list_cat<Lists...>::type |
Convenience alias for type_list_cat<Lists...>::type.
| Lists | Sequence of type_list specializations to be concatenated. |
| using rexlib::type_rule_operand_types_t = typedef typename type_rule_operand_types<Slots, Pivots>::type |
Convenience alias for type_rule_operand_types<Slots, Pivots>::type.
|
strong |
|
strong |
A byte of memory.
An object of any type can be read and written through a pointer to byte, as it can through a pointer to a character type. as_bytes gives such a pointer.
|
strong |
|
strong |
Broad classification of compute devices.
|
strong |
Flags to control the behavior of the joint_layout build behavior.
| Enumerator | |
|---|---|
| enable_reordering | Reorder axes by memory locality. |
| enable_coalescing | Coalesce contiguous axes. |
Enumeration to query memory_resource according to its intended usage.
| Enumerator | |
|---|---|
| host | The memory resource can be optimally accessed by the host. |
| device | The memory resource can be optimally accessed by the device. |
Describes the nature of a memory resource.
Broad categorical classification of numerical_type.
|
strong |
Which batch axes an output supplied in advance may have.
|
strong |
|
strong |
Outcome of resolving a typing rule against concrete operand types.
| array rexlib::abs | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise absolute value of an array.
For complex types, the output is the real equivalent of the input type (e.g. complex_float32 -> float32).
| x | The array from which the absolute value is computed. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::acos | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise arc cosine of an array.
| x | The array whose arc cosine is computed. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::acosh | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise inverse hyperbolic cosine of an array.
| x | The array whose inverse hyperbolic cosine is computed. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::add | ( | const_array_ref | x, |
| const_array_ref | y, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise sum of two arrays.
The inputs must be broadcast-compatible and share the same numerical type. When out is null, the shape and type of the result are deduced from the (broadcast) inputs.
| x | The first array to be added. |
| y | The second array to be added. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
|
noexcept |
Align an address to a higher or equal address that satisfies the provided alignment.
| address | The address to be aligned |
| alignment | The minimum alignment |
|
noexcept |
Align a pointer to a higher or equal address that satisfies the provided alignment.
| T | Pointed value type |
| address | The address to be aligned |
| alignment | The minimum alignment |
|
noexcept |
Align an address to a higher or equal address that satisfies the provided alignment.
| address | The address to be aligned |
| alignment | The minimum alignment |
|
noexcept |
Align an address to a lower or equal address that satisfies the provided alignment.
| address | The address to be aligned |
| alignment | The minimum alignment |
|
noexcept |
Align a pointer to a lower or equal address that satisfies the provided alignment.
| T | Pointed value type |
| address | The address to be aligned |
| alignment | The minimum alignment |
|
noexcept |
Align an address to a lower or equal address that satisfies the provided alignment.
| address | The address to be aligned |
| alignment | The minimum alignment |
|
noexcept |
Allocate memory with an alignment specification.
| size | Number of bytes to allocate. It must be multiple of the alignment. |
| alignment | The alignment of the data. Must be power of two. |
Release a memory block previously allocated with aligned_alloc.
| ptr | Pointer to the data to be freed. |
|
noexcept |
Construct an slice containing all positions in the axis.
| array rexlib::all | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Test whether every element over every axis is true.
| x | The array to be reduced. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::all | ( | const_array_ref | x, |
| span< const std::ptrdiff_t > | axes, | ||
| bool | keep_dimensions, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Test whether every element along the given axes is true.
| x | The array to be reduced. |
| axes | The axes to reduce over. Negative values refer to axes from the end. An empty list reduces over no axis; call the overload without it to reduce over every one. |
| keep_dimensions | Whether the reduced axes are kept with an extent of one instead of being dropped. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::amax | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Take the largest elements of an array over every axis.
| x | The array to be reduced. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::amax | ( | const_array_ref | x, |
| span< const std::ptrdiff_t > | axes, | ||
| bool | keep_dimensions, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Take the largest elements of an array along the given axes.
| x | The array to be reduced. |
| axes | The axes to reduce over. Negative values refer to axes from the end. An empty list reduces over no axis; call the overload without it to reduce over every one. |
| keep_dimensions | Whether the reduced axes are kept with an extent of one instead of being dropped. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::amin | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Take the smallest elements of an array over every axis.
| x | The array to be reduced. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::amin | ( | const_array_ref | x, |
| span< const std::ptrdiff_t > | axes, | ||
| bool | keep_dimensions, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Take the smallest elements of an array along the given axes.
| x | The array to be reduced. |
| axes | The axes to reduce over. Negative values refer to axes from the end. An empty list reduces over no axis; call the overload without it to reduce over every one. |
| keep_dimensions | Whether the reduced axes are kept with an extent of one instead of being dropped. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::angle | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise argument of an array.
| x | The array whose argument is computed. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::any | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Test whether any element over every axis is true.
| x | The array to be reduced. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::any | ( | const_array_ref | x, |
| span< const std::ptrdiff_t > | axes, | ||
| bool | keep_dimensions, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Test whether any element along the given axes is true.
| x | The array to be reduced. |
| axes | The axes to reduce over. Negative values refer to axes from the end. An empty list reduces over no axis; call the overload without it to reduce over every one. |
| keep_dimensions | Whether the reduced axes are kept with an extent of one instead of being dropped. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::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.
The elements are start, start + step, start + 2 * step and so on, stopping before stop is reached or passed, so that the range is half open exactly as a loop over it would be. The length follows from the three of them and is ceil((stop - start) / step), or zero when the step points away from the stop.
The length is worked out in whole numbers when all three bounds are integers, and in double precision otherwise. This mirrors what a loop over the range would count, and is what keeps a purely integral range exact regardless of how large its bounds are.
| start | Value of the first element. |
| stop | Value the progression stops before. |
| step | Difference between one element and the next. |
| data_type | Element type of the array. |
| affinity | Affinity used to select the memory resource where the array is allocated. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| std::invalid_argument | If the step is zero, or if the length the bounds describe is not a finite number. |
| array rexlib::arange | ( | const scalar_value & | start, |
| const scalar_value & | stop, | ||
| numerical_type | data_type, | ||
| memory_resource_affinity | affinity, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Create a one dimensional array counting from start to stop by one.
| start | Value of the first element. |
| stop | Value the progression stops before. |
| data_type | Element type of the array. |
| affinity | Affinity used to select the memory resource where the array is allocated. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::arange | ( | const scalar_value & | stop, |
| numerical_type | data_type, | ||
| memory_resource_affinity | affinity, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Create a one dimensional array counting from zero to stop by one.
| stop | Value the progression stops before. |
| data_type | Element type of the array. |
| affinity | Affinity used to select the memory resource where the array is allocated. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::argmax | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Locate the largest elements of an array over every axis.
| x | The array to be reduced. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::argmax | ( | const_array_ref | x, |
| span< const std::ptrdiff_t > | axes, | ||
| bool | keep_dimensions, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Locate the largest elements of an array along the given axes.
| x | The array to be reduced. |
| axes | The axes to reduce over. Negative values refer to axes from the end. An empty list reduces over no axis; call the overload without it to reduce over every one. |
| keep_dimensions | Whether the reduced axes are kept with an extent of one instead of being dropped. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::argmin | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Locate the smallest elements of an array over every axis.
| x | The array to be reduced. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::argmin | ( | const_array_ref | x, |
| span< const std::ptrdiff_t > | axes, | ||
| bool | keep_dimensions, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Locate the smallest elements of an array along the given axes.
| x | The array to be reduced. |
| axes | The axes to reduce over. Negative values refer to axes from the end. An empty list reduces over no axis; call the overload without it to reduce over every one. |
| keep_dimensions | Whether the reduced axes are kept with an extent of one instead of being dropped. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
View an object as the bytes it is stored in.
| ptr | Pointer to the object. |
View an object as the bytes it is stored in.
| ptr | Pointer to the object. |
| array rexlib::asin | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise arc sine of an array.
| x | The array whose arc sine is computed. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::asinh | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise inverse hyperbolic sine of an array.
| x | The array whose inverse hyperbolic sine is computed. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::atan | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise arc tangent of an array.
| x | The array whose arc tangent is computed. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::atan2 | ( | const_array_ref | y, |
| const_array_ref | x, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise arc tangent of two arrays, by quadrant.
| y | The ordinate array. |
| x | The abscissa array. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::atanh | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise inverse hyperbolic tangent of an array.
| x | The array whose inverse hyperbolic tangent is computed. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
|
noexcept |
Returns a std::size_t type with a single bit set at the provided index.
If the provided index is larger than the width of std::size_t, the result will be zero.
| i | Index of the bit to be set. Zero based, starting from the LSB |
|
noexcept |
Returns the smallest power of 2 not less than the input word.
| T | unsigned type |
| x | The input word |
|
noexcept |
Returns the largest power of 2 not greater than the input word.
If the input word is zero, it returns zero
| T | unsigned type |
| x | The input word |
|
noexcept |
| T | Unsigned integer type |
| start | First bit in the range (0 is LSB) |
| end | Past-the-end bit in the range (0 is LSB) |
|
noexcept |
Returns the number of bits required to represent the input number.
| T | unsigned type |
| x | The input number |
| array rexlib::bitwise_and | ( | const_array_ref | x, |
| const_array_ref | y, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise bitwise conjunction of two arrays.
| x | The first array. |
| y | The second array. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::bitwise_not | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Invert the bits of every element of an array.
| x | The array whose bits are inverted. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::bitwise_or | ( | const_array_ref | x, |
| const_array_ref | y, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise bitwise disjunction of two arrays.
| x | The first array. |
| y | The second array. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::bitwise_xor | ( | const_array_ref | x, |
| const_array_ref | y, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise bitwise exclusive disjunction of two arrays.
| x | The first array. |
| y | The second array. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| void rexlib::broadcast_extents | ( | std::vector< std::size_t > & | extents1, |
| std::vector< std::size_t > & | extents2 | ||
| ) |
Perform a broadcast operation between two sets of extents.
This operation pads the smallest set of extents with ones at the beginning. Then, both sets are iterated jointly. If both elements are equal, none of them is modified. If unequal but one of them is 1, it is replaced by the other. Otherwise an exception is thrown.
| extents1 | The first set of extents. |
| extents2 | The second set of extents. |
| std::broadcast_error | when one of of the extents cannot be broadcasted. |
| void rexlib::broadcast_extents_accumulate | ( | std::vector< std::size_t > & | result, |
| span< const std::size_t > | other | ||
| ) |
Perform an cumulative extent broadcast step.
| result | The extent vector to be updated. After a successful call, the broadcast result between the previous value of result and other is stored. |
| other | The other set of extents. |
| std::broadcast_error | when one of of the extents cannot be broadcasted. |
| array rexlib::cast | ( | array & | input, |
| numerical_type | target_type, | ||
| const execution_context & | context | ||
| ) |
Cast an array to a given numerical type.
When the array already has the requested type, an alias of the input is returned without copying its data. Otherwise, a new array holding the cast elements is allocated and returned.
| input | The array to be cast. |
| target_type | The numerical type to cast the array to. |
| context | The execution context used for dispatching. |
| array rexlib::cast_copy | ( | const_array_ref | input, |
| numerical_type | target_type, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Cast an array to a given numerical type into a new array.
Unlike cast, this function always allocates a new array holding the cast elements, even when the input already has the requested type.
| input | The array to be cast. |
| target_type | The numerical type to cast the array to. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::cbrt | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise cube root of an array.
| x | The array whose cube root is computed. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::ceil | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Round the elements of an array upwards.
| x | The array to be rounded. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
|
noexcept |
Sets the lowest '1' bit to '0' in place.
When there are no bits to be cleared (because all are '0'-s) it does not have any effect
| T | unsigned type |
| x | The input/output word |
| array rexlib::clip | ( | const_array_ref | x, |
| const_array_ref | lower, | ||
| const_array_ref | upper, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Confine the elements of an array to an interval.
| x | The array to be confined. |
| lower | The lower bound. |
| upper | The upper bound. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| std::size_t rexlib::compute_storage_requirement | ( | const array_descriptor & | descriptor | ) |
Compute the number of bytes required to store the given descriptor.
| descriptor | The descriptor from which the storage requirement is computed. |
| array rexlib::conjugate | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise conjugate of an array.
| x | The array to be conjugated. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::copy | ( | const_array_ref | source, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Create an array as a copy of an existing one.
| source | The array to be copied. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::copysign | ( | const_array_ref | x, |
| const_array_ref | y, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compose an array from the magnitude of one and the sign of another.
| x | The array supplying the magnitude. |
| y | The array supplying the sign. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::cos | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise cosine of an array.
| x | The array whose cosine is computed. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::cosh | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise hyperbolic cosine of an array.
| x | The array whose hyperbolic cosine is computed. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
|
noexcept |
Counts the number of consecutive '1's from the MSB.
| T | unsigned type |
| x | The input word |
|
noexcept |
Counts the number of consecutive '0's from the MSB.
| T | unsigned type |
| x | The input word |
| array rexlib::count_nonzero | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Count the non zero elements over every axis.
| x | The array to be reduced. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::count_nonzero | ( | const_array_ref | x, |
| span< const std::ptrdiff_t > | axes, | ||
| bool | keep_dimensions, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Count the non zero elements along the given axes.
| x | The array to be reduced. |
| axes | The axes to reduce over. Negative values refer to axes from the end. An empty list reduces over no axis; call the overload without it to reduce over every one. |
| keep_dimensions | Whether the reduced axes are kept with an extent of one instead of being dropped. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
|
noexcept |
Counts the number of consecutive '1's from the LSB.
| T | unsigned type |
| x | The input word |
|
noexcept |
Counts the number of consecutive '0's from the LSB.
| T | unsigned type |
| x | The input word |
| array rexlib::cross | ( | const_array_ref | x, |
| const_array_ref | y, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Take the cross product of two arrays along their last axis.
| x | The first array. |
| y | The second array. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::cross | ( | const_array_ref | x, |
| const_array_ref | y, | ||
| std::ptrdiff_t | axis, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Take the cross product of two arrays along one axis.
| x | The first array. |
| y | The second array. |
| axis | The axis to take the product along. Negative values refer to axes from the end. It must have three components. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::degrees | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Convert an array from radians to degrees.
| x | The array to be converted, in radians. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| std::string rexlib::describe_operand | ( | const operation_descriptor & | descriptor, |
| std::size_t | index, | ||
| bool | output_operand | ||
| ) |
Describe an operand for a diagnostic.
Yields the operand's quoted name when it has one and its index otherwise, so that building a message never depends on a name being present.
| descriptor | The operation description. |
| index | Index of the operand. |
| output_operand | Whether the operand is an output. |
| void rexlib::discover_plugins | ( | const std::string & | directory, |
| plugin_manager & | manager | ||
| ) |
Discover and load all plugins in a directory.
| directory | Directory where plugins are searched. |
| manager | Plugin manager where plugins are loaded. |
| void rexlib::discover_plugins | ( | plugin_manager & | manager | ) |
Discover and load all plugins in the search path.
| manager | Plugin manager where plugins are loaded. |
Dispatch a function with the numerical types.
This function dispatches a set of numerical_type-s and calls the provided visitor with the dispatched types wrapped around a type_tag. In case a type fails conversion to a C++ type, type_tag<void> is passed.
| F | Functor to be dispatched. |
| Types | any amount of numeric_type-s |
| visitor | Function to be called with the dispatched types. |
| types | Types to be dispatched. |
| array rexlib::divide | ( | const_array_ref | x, |
| const_array_ref | y, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise quotient of two arrays.
The inputs must be broadcast-compatible and share the same numerical type. When out is null, the shape and type of the result are deduced from the (broadcast) inputs.
| x | The dividend array. |
| y | The divisor array. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| std::pair< array, array > rexlib::divmod | ( | const_array_ref | x, |
| const_array_ref | y, | ||
| const execution_context & | context, | ||
| array * | quotient = nullptr, |
||
| array * | remainder = nullptr |
||
| ) |
Compute the element-wise quotient and remainder of two arrays.
Computing both at once is cheaper than calling floor_divide and modulo in turn, the division being the expensive half of each, and the two results agree by construction.
| x | The dividend array. |
| y | The divisor array. |
| context | The execution context used for dispatching. |
| quotient | Optional output parameter to be re-used. |
| remainder | Optional output parameter to be re-used. |
|
noexcept |
Construct an ellipsis_tag.
| array rexlib::empty | ( | array_descriptor | descriptor, |
| memory_resource_affinity | affinity, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Create an array without initializing its elements.
| descriptor | Describes the shape and data type of the array. |
| affinity | Affinity used to select the memory resource where the array is allocated. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
|
noexcept |
Get the value representing the end of an array to be used as count.
| std::uint64_t rexlib::entropy_seed | ( | ) |
Draw a seed from the entropy source of the system.
The seed joins two draws of std::random_device, so all of its 64 bits are random. Each call gives a different seed, and the result can be recorded to repeat a computation.
| std::exception | When std::random_device cannot reach an entropy source. |
| array rexlib::equal | ( | const_array_ref | x, |
| const_array_ref | y, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Test element-wise whether one array is equal to another.
| x | The first array. |
| y | The second array. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
|
noexcept |
Construct an slice containing even positions in the axis.
| void rexlib::execute | ( | const operation & | operation, |
| span< array > | output_operands, | ||
| span< const const_array_ref > | input_operands, | ||
| const execution_context & | context | ||
| ) |
Execute a operation.
| operation | The operation to be executed. |
| output_operands | The output operands. |
| input_operands | The input operands. |
| context | The execution context used for dispatching. |
| array rexlib::execute | ( | const operation & | operation, |
| span< const const_array_ref > | input_operands, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Execute a operation.
| operation | The operation to be executed. |
| input_operands | The input operands. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::execute_binary | ( | const operation & | operation, |
| const_array_ref | first_input, | ||
| const_array_ref | second_input, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Execute an unary operation.
| operation | The operation to be executed. |
| first_input | The first input operand. |
| second_input | The second input operand. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| void rexlib::execute_binary | ( | const operation & | operation, |
| span< array > | output_operands, | ||
| const_array_ref | first_input, | ||
| const_array_ref | second_input, | ||
| const execution_context & | context | ||
| ) |
Execute a binary operation producing several outputs.
| operation | The operation to be executed. |
| output_operands | The output operands, in signature order. |
| first_input | The first input operand. |
| second_input | The second input operand. |
| context | The execution context used for dispatching. |
| array rexlib::execute_ternary | ( | const operation & | operation, |
| const_array_ref | first_input, | ||
| const_array_ref | second_input, | ||
| const_array_ref | third_input, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Execute an unary operation.
| operation | The operation to be executed. |
| first_input | The first input operand. |
| second_input | The second input operand. |
| third_input | The third input operand. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::execute_unary | ( | const operation & | operation, |
| const const_array_ref & | input, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Execute an unary operation.
| operation | The operation to be executed. |
| input | The input operand. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| void rexlib::execute_unary | ( | const operation & | operation, |
| span< array > | output_operands, | ||
| const_array_ref | input, | ||
| const execution_context & | context | ||
| ) |
Execute an unary operation producing several outputs.
Unlike the single output form there is nothing to return: an output that already holds storage is reused and one that does not is allocated and written back in place, so the results are delivered through output_operands.
| operation | The operation to be executed. |
| output_operands | The output operands, in signature order. |
| input | The input operand. |
| context | The execution context used for dispatching. |
| array rexlib::exp | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise exponential of an array.
| x | The array whose exponential is computed. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::exp2 | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise base two exponential of an array.
| x | The array whose exponential is computed. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::expm1 | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise exponential of an array, minus one.
| x | The array whose exponential is computed. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::fft | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Transform an array to the frequency domain.
Transforms along the last axis and treats the rest as batch dimensions, which is how one dimensional data is usually laid out.
| x | The array to be transformed. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::fft | ( | const_array_ref | x, |
| ops::fourier_normalization | normalization, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Transform an array to the frequency domain.
Transforms along the last axis and treats the rest as batch dimensions, which is how one dimensional data is usually laid out.
| x | The array to be transformed. |
| normalization | Which of the transform pair carries the scaling. A transform and its inverse undo one another whenever they are given the same one. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::fft | ( | const_array_ref | x, |
| span< const std::ptrdiff_t > | axes, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Transform an array to the frequency domain.
| x | The array to be transformed. |
| axes | The axes to transform along. Negative values refer to axes from the end. The remaining axes are batch dimensions. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::fft | ( | const_array_ref | x, |
| span< const std::ptrdiff_t > | axes, | ||
| ops::fourier_normalization | normalization, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Transform an array to the frequency domain.
| x | The array to be transformed. |
| axes | The axes to transform along. Negative values refer to axes from the end. The remaining axes are batch dimensions. |
| normalization | Which of the transform pair carries the scaling. A transform and its inverse undo one another whenever they are given the same one. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::fft2 | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Transform an array to the frequency domain.
Transforms along the last two axes and treats the rest as batch dimensions, which is how image data is usually laid out.
| x | The array to be transformed. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::fft2 | ( | const_array_ref | x, |
| ops::fourier_normalization | normalization, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Transform an array to the frequency domain.
Transforms along the last two axes and treats the rest as batch dimensions, which is how image data is usually laid out.
| x | The array to be transformed. |
| normalization | Which of the transform pair carries the scaling. A transform and its inverse undo one another whenever they are given the same one. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::fft3 | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Transform an array to the frequency domain.
Transforms along the last three axes and treats the rest as batch dimensions, which is how volume data is usually laid out.
| x | The array to be transformed. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::fft3 | ( | const_array_ref | x, |
| ops::fourier_normalization | normalization, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Transform an array to the frequency domain.
Transforms along the last three axes and treats the rest as batch dimensions, which is how volume data is usually laid out.
| x | The array to be transformed. |
| normalization | Which of the transform pair carries the scaling. A transform and its inverse undo one another whenever they are given the same one. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::fftshift | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Move the zero frequency of a spectrum to its centre.
Shifts along every axis.
| x | The array to be shifted. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::fftshift | ( | const_array_ref | x, |
| span< const std::ptrdiff_t > | axes, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Move the zero frequency of a spectrum to its centre.
| x | The array to be shifted. |
| axes | The axes to shift along. Negative values refer to axes from the end. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| void rexlib::fill | ( | array & | out, |
| const scalar_value & | fill_value, | ||
| const execution_context & | context | ||
| ) |
Set all the elements of an array to a given value.
| out | The array whose elements are set. |
| fill_value | Value to which all the elements are set. |
| context | The execution context used for dispatching. |
| array rexlib::floor | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Round the elements of an array downwards.
| x | The array to be rounded. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::floor_divide | ( | const_array_ref | x, |
| const_array_ref | y, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise floor division of two arrays.
The inputs must be broadcast-compatible and share the same numerical type. When out is null, the shape and type of the result are deduced from the (broadcast) inputs.
| x | The dividend array. |
| y | The divisor array. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::fold_in_key | ( | const_array_ref | key, |
| const_array_ref | data, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Derive keys from keys and values.
| key | The uint64 keys. |
| data | The uint64 values folded into the keys. It broadcasts against key. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::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.
| descriptor | Describes the shape and data type of the array. |
| affinity | Affinity used to select the memory resource where the array is allocated. |
| fill_value | Value to which all the elements are set. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
|
noexcept |
Get the alignment of an address.
Finds the largest power of two that is a divisor of the address
| address | The address of which the alignment is determined |
|
noexcept |
Get the alignment of a pointer.
Finds the largest power of two that is a divisor of the address
| T | Pointed value type |
| address | The address of which the alignment is determined |
| std::size_t rexlib::get_available_system_memory | ( | ) |
Get the memory available in the system.
|
noexcept |
Get the category of the provided numerical type.
| type | The type from which the category is inferred. |
numerical_type_category::unknown if error.| std::string rexlib::get_default_plugin_directory | ( | ) |
Get the default plugin directory.
Returns the path to a sub-directory named as "plugins" located in the same directory as the shared library of the core.
Get where an array holds its values, on the host, to write them.
Blocks the calling thread until the commands that read or write the memory of the array have finished.
| array | The array to reach. |
| std::invalid_argument | If array is not initialized. |
| unsupported_capability_error | If its storage is not host accessible. |
| const void * rexlib::get_host_data | ( | const_array_ref | array | ) |
Get where an array holds its values, on the host, to read them.
Blocks the calling thread until the commands that write the memory of the array have finished.
| array | The array to reach. |
| std::invalid_argument | If array is not initialized. |
| unsupported_capability_error | If its storage is not host accessible. |
|
noexcept |
Get the resource representing host memory.
The returned resource has kind memory_resource_kind::host. It represents plain host-addressable memory.
| std::string rexlib::get_hostname | ( | ) |
Get the hostname of the machine.
|
noexcept |
Get the version of the rexlib installation.
This function returns the version of the loaded rexlib .so file
|
noexcept |
Get the data types an operation instance supplies to its typing rule.
Evaluates the accessors of the rule's operation supplied pivots on the parameters of the operation. An operation whose rule has none supplies none, whether it has parameters or not.
| Op | The concrete operation type. |
| operation | The operation instance. |
| std::size_t rexlib::get_page_size | ( | ) |
Get the page size of the memory management subsystem.
| std::vector< std::string > rexlib::get_plugin_search_path | ( | ) |
Get the directories where plugins are searched for.
The entries of the REXLIB_PLUGINS_PATH environment variable come first, in the order they are written, separated by the platform's path separator. The default plugin directory is always searched last, so that setting the variable adds locations rather than hiding the installed plugins. Duplicates are removed.
|
noexcept |
Get the size of a numerical type.
| type | The type for which the size should be obtained. |
| std::size_t rexlib::get_total_system_memory | ( | ) |
Get the total memory available in the system.
| array rexlib::greater | ( | const_array_ref | x, |
| const_array_ref | y, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Test element-wise whether one array is greater than another.
| x | The first array. |
| y | The second array. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::greater_equal | ( | const_array_ref | x, |
| const_array_ref | y, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Test element-wise whether one array is greater than or equal to another.
| x | The first array. |
| y | The second array. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
|
noexcept |
Checks if the input word has one and only one bit set to '1'.
| T | unsigned type |
| x | The input word |
| array rexlib::hypot | ( | const_array_ref | x, |
| const_array_ref | y, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise hypotenuse of two arrays.
| x | The first array. |
| y | The second array. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::ifft | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Transform an array back from the frequency domain.
Transforms along the last axis and treats the rest as batch dimensions, which is how one dimensional data is usually laid out.
| x | The array to be transformed. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::ifft | ( | const_array_ref | x, |
| ops::fourier_normalization | normalization, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Transform an array back from the frequency domain.
Transforms along the last axis and treats the rest as batch dimensions, which is how one dimensional data is usually laid out.
| x | The array to be transformed. |
| normalization | Which of the transform pair carries the scaling. A transform and its inverse undo one another whenever they are given the same one. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::ifft | ( | const_array_ref | x, |
| span< const std::ptrdiff_t > | axes, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Transform an array back from the frequency domain.
| x | The array to be transformed. |
| axes | The axes to transform along. Negative values refer to axes from the end. The remaining axes are batch dimensions. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::ifft | ( | const_array_ref | x, |
| span< const std::ptrdiff_t > | axes, | ||
| ops::fourier_normalization | normalization, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Transform an array back from the frequency domain.
| x | The array to be transformed. |
| axes | The axes to transform along. Negative values refer to axes from the end. The remaining axes are batch dimensions. |
| normalization | Which of the transform pair carries the scaling. A transform and its inverse undo one another whenever they are given the same one. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::ifft2 | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Transform an array back from the frequency domain.
Transforms along the last two axes and treats the rest as batch dimensions, which is how image data is usually laid out.
| x | The array to be transformed. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::ifft2 | ( | const_array_ref | x, |
| ops::fourier_normalization | normalization, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Transform an array back from the frequency domain.
Transforms along the last two axes and treats the rest as batch dimensions, which is how image data is usually laid out.
| x | The array to be transformed. |
| normalization | Which of the transform pair carries the scaling. A transform and its inverse undo one another whenever they are given the same one. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::ifft3 | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Transform an array back from the frequency domain.
Transforms along the last three axes and treats the rest as batch dimensions, which is how volume data is usually laid out.
| x | The array to be transformed. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::ifft3 | ( | const_array_ref | x, |
| ops::fourier_normalization | normalization, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Transform an array back from the frequency domain.
Transforms along the last three axes and treats the rest as batch dimensions, which is how volume data is usually laid out.
| x | The array to be transformed. |
| normalization | Which of the transform pair carries the scaling. A transform and its inverse undo one another whenever they are given the same one. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::ifftshift | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Move the zero frequency of a spectrum back to its origin.
Shifts along every axis.
| x | The array to be shifted. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::ifftshift | ( | const_array_ref | x, |
| span< const std::ptrdiff_t > | axes, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Move the zero frequency of a spectrum back to its origin.
| x | The array to be shifted. |
| axes | The axes to shift along. Negative values refer to axes from the end. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
Obtain a view of the imaginary part of an array.
As with real, nothing is computed and the result aliases x.
Unlike real this is not defined for every array: the imaginary part of a real array is zero everywhere, and no view can produce a value the storage does not hold. Build it with zeros instead.
| x | The array whose imaginary part is viewed. Must be complex. |
x.| std::invalid_argument | If x is not complex. |
| array rexlib::irfft | ( | const_array_ref | x, |
| span< const std::ptrdiff_t > | axes, | ||
| std::size_t | extent, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Transform a half spectrum back into a real array.
| x | The half spectrum to be transformed. |
| axes | The axes to transform along. Negative values refer to axes from the end. The remaining axes are batch dimensions. |
| extent | The number of samples along the last transformed axis. That axis must hold extent / 2 + 1 coefficients. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::irfft | ( | const_array_ref | x, |
| span< const std::ptrdiff_t > | axes, | ||
| std::size_t | extent, | ||
| ops::fourier_normalization | normalization, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Transform a half spectrum back into a real array.
| x | The half spectrum to be transformed. |
| axes | The axes to transform along. Negative values refer to axes from the end. The remaining axes are batch dimensions. |
| extent | The number of samples along the last transformed axis. That axis must hold extent / 2 + 1 coefficients. |
| normalization | Which of the transform pair carries the scaling. A transform and its inverse undo one another whenever they are given the same one. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::irfft | ( | const_array_ref | x, |
| std::size_t | extent, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Transform a half spectrum back into a real array.
Transforms along the last axis and treats the rest as batch dimensions.
| x | The half spectrum to be transformed. |
| extent | The number of samples along the last transformed axis. That axis must hold extent / 2 + 1 coefficients. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::irfft | ( | const_array_ref | x, |
| std::size_t | extent, | ||
| ops::fourier_normalization | normalization, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Transform a half spectrum back into a real array.
Transforms along the last axis and treats the rest as batch dimensions.
| x | The half spectrum to be transformed. |
| extent | The number of samples along the last transformed axis. That axis must hold extent / 2 + 1 coefficients. |
| normalization | Which of the transform pair carries the scaling. A transform and its inverse undo one another whenever they are given the same one. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::irfft2 | ( | const_array_ref | x, |
| std::size_t | extent, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Transform a half spectrum back into a real array.
Transforms along the last two axes and treats the rest as batch dimensions.
| x | The half spectrum to be transformed. |
| extent | The number of samples along the last transformed axis. That axis must hold extent / 2 + 1 coefficients. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::irfft2 | ( | const_array_ref | x, |
| std::size_t | extent, | ||
| ops::fourier_normalization | normalization, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Transform a half spectrum back into a real array.
Transforms along the last two axes and treats the rest as batch dimensions.
| x | The half spectrum to be transformed. |
| extent | The number of samples along the last transformed axis. That axis must hold extent / 2 + 1 coefficients. |
| normalization | Which of the transform pair carries the scaling. A transform and its inverse undo one another whenever they are given the same one. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::irfft3 | ( | const_array_ref | x, |
| std::size_t | extent, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Transform a half spectrum back into a real array.
Transforms along the last three axes and treats the rest as batch dimensions.
| x | The half spectrum to be transformed. |
| extent | The number of samples along the last transformed axis. That axis must hold extent / 2 + 1 coefficients. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::irfft3 | ( | const_array_ref | x, |
| std::size_t | extent, | ||
| ops::fourier_normalization | normalization, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Transform a half spectrum back into a real array.
Transforms along the last three axes and treats the rest as batch dimensions.
| x | The half spectrum to be transformed. |
| extent | The number of samples along the last transformed axis. That axis must hold extent / 2 + 1 coefficients. |
| normalization | Which of the transform pair carries the scaling. A transform and its inverse undo one another whenever they are given the same one. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
|
noexcept |
Check if an address is aligned to the provided boundary.
| address | The address to be checked. |
| alignment | The alignment requirement to be checked. |
|
noexcept |
Check if a pointer is aligned to the provided boundary.
| T | Pointed value type |
| address | The address to be checked. |
| alignment | The alignment requirement to be checked. |
|
noexcept |
Check if two extents can be broadcasted together.
| extents1 | The first set of extents. |
| extents2 | The second set of extents. |
|
noexcept |
Check if a set of extents can be broadcasted into another.
| from_extents | The extents to be broadcasted. |
| to_extents | The target set of extents. |
|
noexcept |
Check if the memory kind can be directly accessed from the device.
| kind | Memory resource kind to be checked. |
|
noexcept |
Check whether a type has a bit representation within a domain.
Only the enumerators in [numerical_type::boolean, numerical_type::count) are representable. In particular numerical_type::unknown is not.
| type | The type to be tested. |
| array rexlib::is_finite | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Test element-wise whether an array holds finite values.
| x | The array to be tested. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
|
noexcept |
Check if the memory kind can be directly accessed from the host.
| kind | Memory resource kind to be checked. |
| array rexlib::is_inf | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Test element-wise whether an array holds infinite values.
| x | The array to be tested. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
|
noexcept |
Check if the array descriptor is initialized.
| descriptor | The descriptor to check. |
| array rexlib::is_nan | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Test element-wise whether an array holds values that are not numbers.
| x | The array to be tested. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::left_shift | ( | const_array_ref | x, |
| const_array_ref | y, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Shift the bits of an array leftwards.
| x | The array whose bits are shifted. |
| y | The number of positions to shift by. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::less | ( | const_array_ref | x, |
| const_array_ref | y, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Test element-wise whether one array is less than another.
| x | The first array. |
| y | The second array. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::less_equal | ( | const_array_ref | x, |
| const_array_ref | y, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Test element-wise whether one array is less than or equal to another.
| x | The first array. |
| y | The second array. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::linspace | ( | const scalar_value & | start, |
| const scalar_value & | stop, | ||
| std::size_t | count, | ||
| bool | endpoint, | ||
| numerical_type | data_type, | ||
| memory_resource_affinity | affinity, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Create a one dimensional array of evenly spaced samples.
| start | Value of the first element. |
| stop | End of the sampled segment. |
| count | Number of samples. |
| endpoint | Whether stop is itself a sample. When it is not, the samples are those of the half open segment, so that consecutive blocks of them tile the line without repeating a value. |
| data_type | Element type of the array. It must be a floating point or complex type. |
| affinity | Affinity used to select the memory resource where the array is allocated. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::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.
Takes count samples of the segment going from start to stop, both ends included. Unlike arange the length is what the caller states and the spacing is what follows from it, which is why the last element is exactly stop however the spacing rounds.
| start | Value of the first element. |
| stop | Value of the last element. |
| count | Number of samples. |
| data_type | Element type of the array. It must be a floating point or complex type: evenly spaced samples generally have a fractional part, and arange is the one that enumerates whole numbers. |
| affinity | Affinity used to select the memory resource where the array is allocated. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::log | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise natural logarithm of an array.
| x | The array whose logarithm is computed. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::log10 | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise base ten logarithm of an array.
| x | The array whose logarithm is computed. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::log1p | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise natural logarithm of one plus an array.
| x | The array to which one is added. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::log2 | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise base two logarithm of an array.
| x | The array whose logarithm is computed. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::logical_and | ( | const_array_ref | x, |
| const_array_ref | y, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise conjunction of two arrays.
| x | The first array. |
| y | The second array. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::logical_not | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise negation of an array.
| x | The array to be negated. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::logical_or | ( | const_array_ref | x, |
| const_array_ref | y, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise disjunction of two arrays.
| x | The first array. |
| y | The second array. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::logical_xor | ( | const_array_ref | x, |
| const_array_ref | y, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise exclusive disjunction of two arrays.
| x | The first array. |
| y | The second array. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
|
noexcept |
Create a complex version, if exists.
Create the complex version of a numerical type, if this exists. Otherwise unknown is returned. This includes an already complex type.
| type |
| array_descriptor rexlib::make_contiguous_array_descriptor | ( | span< const std::size_t > | extents, |
| numerical_type | data_type | ||
| ) |
Create an array descriptor with a contiguous layout.
The resulting descriptor holds a contiguous layout built from the given extents paired with the provided numerical type.
| extents | The extents of each dimension. |
| data_type | The numerical type. |
| std::shared_ptr< dispatcher > rexlib::make_eager_dispatcher | ( | std::shared_ptr< const program_manager > | program_manager | ) |
Create a dispatcher that submits operations eagerly.
The returned dispatcher builds and submits the executable program for each operation as soon as it is dispatched, caching backend-private resources (compiled kernels, FFT plans, ...) so they are reused across builds with matching launch configurations.
| program_manager | The manager queried to build the program for each operation. Must not be null. |
| std::invalid_argument | if program_manager is null. |
|
noexcept |
Build the domain an extent domain tag names.
| Domain | The tag. It must provide static bool contains(std::size_t) and static const char* get_description(). |
|
noexcept |
Erase an extent transform tag.
| Transform | An extent transform, such as same_extent_transform. |
|
noexcept |
Get the inexact equivalent of a numerical type.
Types that can only represent whole values, which is to say booleans and integers, map onto float64, the widest type able to hold their result. Floating point and complex types already have a fractional part and are returned unchanged.
Models the result type of operations whose value is not representable in the operand's own type, such as a mean. Characters are not admitted: they are not a numeric quantity to average.
| type | The type to be made inexact. |
| array rexlib::make_key | ( | std::uint64_t | seed, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Create a key from a seed.
A key is a uint64 element. The key of a seed holds the seed unchanged.
| seed | The seed. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
|
noexcept |
Create the domain holding every type of a given category.
| category | The category of the types belonging to the domain. |
|
noexcept |
Build an operand name list.
| names | The operand names, in signature order. |
|
noexcept |
Build a descriptor from compile time operand name lists.
| OutputCount | Number of output operands. |
| InputCount | Number of input operands. |
| component | Name of the component owning the operation. |
| name | Name of the operation. |
| outputs | Names of the output operands. |
| inputs | Names of the input operands. |
|
noexcept |
Get the real equivalent of a numerical type.
For complex types, returns the corresponding floating-point type (e.g. complex_float32 -> float32). For other valid types it returns the type itself.
| type | A potentially complex numerical type. |
|
noexcept |
Create an slice using its start and count values.
The step is defaulted to be 1.
| start | Index of the first element |
| count | Number of elements. |
|
noexcept |
Create an slice using its start and count values.
The step is defaulted to be 1.
| start | Index of the first element |
| count | Number of elements. |
| step | Jump between consecutive elements. |
|
noexcept |
Create an slice using its count value.
The start is defaulter to be 0. The step is defaulted to be 1.
| count | Number of elements. |
|
noexcept |
Erase a type transform tag.
| Transform | A type transform, such as same_type_transform. |
|
noexcept |
Returns a mask for all the consecutive trailing '1'-s of the input word.
Examples: 0b00000111 -> 0b00000111
0b00000110 -> 0b00000000
0b00000101 -> 0b00000001
| T | unsigned type |
| x | The input word |
|
noexcept |
Returns a mask for all the consecutive trailing '0'-s of the input word.
Examples: 0b00000111 -> 0b00000000
0b00000110 -> 0b00000001
0b00000100 -> 0b00000011
0b00000000 -> 0b11111111
| T | unsigned type |
| x | The input word |
| array rexlib::matmul | ( | const_array_ref | x, |
| const_array_ref | y, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Multiply two arrays as stacks of matrices.
| x | The first array. |
| y | The second array. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::matvec | ( | const_array_ref | x, |
| const_array_ref | y, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Multiply a stack of matrices by a stack of vectors.
| x | The stack of matrices. |
| y | The stack of vectors. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::maximum | ( | const_array_ref | x, |
| const_array_ref | y, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Take the element-wise maximum of two arrays.
Selects, element by element, whichever of the two operands is greater, which is the lower half of a clip taken on its own.
| x | The first array. |
| y | The second array. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::mean | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Average the elements of an array over every axis.
| x | The array to be reduced. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::mean | ( | const_array_ref | x, |
| span< const std::ptrdiff_t > | axes, | ||
| bool | keep_dimensions, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Average the elements of an array along the given axes.
| x | The array to be reduced. |
| axes | The axes to reduce over. Negative values refer to axes from the end. An empty list reduces over no axis; call the overload without it to reduce over every one. |
| keep_dimensions | Whether the reduced axes are kept with an extent of one instead of being dropped. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::minimum | ( | const_array_ref | x, |
| const_array_ref | y, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Take the element-wise minimum of two arrays.
Selects, element by element, whichever of the two operands is smaller, which is the upper half of a clip taken on its own.
| x | The first array. |
| y | The second array. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::modulo | ( | const_array_ref | x, |
| const_array_ref | y, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise modulo of two arrays.
The inputs must be broadcast-compatible and share the same numerical type. When out is null, the shape and type of the result are deduced from the (broadcast) inputs.
| x | The dividend array. |
| y | The divisor array. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::multiply | ( | const_array_ref | x, |
| const_array_ref | y, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise product of two arrays.
The inputs must be broadcast-compatible and share the same numerical type. When out is null, the shape and type of the result are deduced from the (broadcast) inputs.
| x | The first array to be multiplied. |
| y | The second array to be multiplied. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::negate | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise negation of an array.
| x | The array to be negated. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
|
noexcept |
Construct a new_axis_tag.
| array rexlib::not_equal | ( | const_array_ref | x, |
| const_array_ref | y, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Test element-wise whether one array is different from another.
| x | The first array. |
| y | The second array. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
|
noexcept |
Explicitly cast a numerical value from one type to another.
Behaves like static_cast<T> for ordinary arithmetic types, but avoids the implicit intermediate conversions that static_cast performs when float16_t is involved. As float16_t interoperates with the rest of the world exclusively through float, a plain static_cast<T> to or from float16_t hides a second, implicit conversion (e.g. double -> float -> float16_t).
The conversion is applied element-wise for std::complex operands, so that complex values holding float16_t components are handled as well.
| T | Destination type. |
| Q | Source type (deduced). |
| src | Value to convert. |
|
noexcept |
Construct an slice containing odd positions in the axis.
| REXLIB_NODISCARD T * rexlib::offset_bytes | ( | T * | address, |
| std::ptrdiff_t | count | ||
| ) |
Offset an address by a given amount of bytes.
| T | Pointed type. |
| address | Pointer to be modified. |
| count | Number of bytes to add. |
| array rexlib::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.
| descriptor | Describes the shape and data type of the array. |
| affinity | Affinity used to select the memory resource where the array is allocated. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
Downcast an operation after checking its identity.
Program builders reach an operation's parameters by downcasting it. Doing so through the operation id rather than through RTTI matches how the builder was selected in the first place, and accepts a subclass that reports its base's identity, which is exactly the substitutability the identity is supposed to express.
| Op | The concrete operation type. |
| op | The operation to be downcast. |
| std::invalid_argument | When op is not an Op. |
|
noexcept |
Compute the complement of a domain.
The complement is taken with respect to the set of all representable types, so no unrepresentable bit is ever set.
|
noexcept |
Computes the parity of the input word.
When the number of '1's in the input word is odd it returns true. Otherwise it returns false.
| T | unsigned type |
| x | The input word |
| bool rexlib::parse_device_index | ( | const std::string & | text, |
| device_index & | result | ||
| ) |
Parse the device ID from a string.
A device ID string representation is expected to be:
<device_backend>:<device_id><device_backend> (assumes device_id is 0)| text | Appropriately formatted string with the device ID |
| result | Output device_index object. |
|
noexcept |
Counts the number '1's in the input word.
| T | unsigned type |
| x | The input word |
| array rexlib::power | ( | const_array_ref | x, |
| const_array_ref | y, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Raise the elements of an array to the power of another.
The inputs must be broadcast-compatible and share the same numerical type. When out is null, the shape and type of the result are deduced from the (broadcast) inputs.
| x | The base array. |
| y | The exponent array. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::product | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Multiply the elements of an array over every axis.
| x | The array to be reduced. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::product | ( | const_array_ref | x, |
| span< const std::ptrdiff_t > | axes, | ||
| bool | keep_dimensions, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Multiply the elements of an array along the given axes.
| x | The array to be reduced. |
| axes | The axes to reduce over. Negative values refer to axes from the end. An empty list reduces over no axis; call the overload without it to reduce over every one. |
| keep_dimensions | Whether the reduced axes are kept with an extent of one instead of being dropped. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
|
noexcept |
Get the common type of two numerical types.
The type promotion mechanism is heavily influenced by JAX's approach: https://docs.jax.dev/en/latest/jep/9407-type-promotion.html
However, unlike JAX, it allows type promotion from uint64 to int64.
| type1 | First numerical type. |
| type2 | Second numerical type. |
| array rexlib::radians | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Convert an array from degrees to radians.
| x | The array to be converted, in degrees. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
Obtain a view of the real part of an array.
Nothing is computed and nothing is allocated. A complex array is an array of twice as many real values, std::complex being layout compatible with an array of two of its value type, so the real parts are reachable by doubling the strides. The result therefore aliases x, and writing through it writes into x.
A real array is already its own real part and is returned as a plain alias.
Being a view rather than an operation, this needs no execution context and reaches no backend. Call array::share_const on the result for a read-only alias.
| x | The array whose real part is viewed. |
x.| array rexlib::reciprocal | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise reciprocal of an array.
| x | The array whose reciprocal is computed. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| std::size_t rexlib::register_all_plugins_at | ( | const plugin_manager & | manager, |
| service_catalog & | catalog | ||
| ) |
Register all plugins from a plugin manager into an interface catalog.
| manager | The plugin_manager that contains the plugins to be registered. |
| catalog | Interface catalog where plugins will be registered. |
| array rexlib::rfft | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Transform a real array to the frequency domain.
Transforms along the last axis and treats the rest as batch dimensions, which is how one dimensional data is usually laid out.
| x | The array to be transformed. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::rfft | ( | const_array_ref | x, |
| ops::fourier_normalization | normalization, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Transform a real array to the frequency domain.
Transforms along the last axis and treats the rest as batch dimensions, which is how one dimensional data is usually laid out.
| x | The array to be transformed. |
| normalization | Which of the transform pair carries the scaling. A transform and its inverse undo one another whenever they are given the same one. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::rfft | ( | const_array_ref | x, |
| span< const std::ptrdiff_t > | axes, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Transform a real array to the frequency domain.
| x | The array to be transformed. |
| axes | The axes to transform along. Negative values refer to axes from the end. The remaining axes are batch dimensions. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::rfft | ( | const_array_ref | x, |
| span< const std::ptrdiff_t > | axes, | ||
| ops::fourier_normalization | normalization, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Transform a real array to the frequency domain.
| x | The array to be transformed. |
| axes | The axes to transform along. Negative values refer to axes from the end. The remaining axes are batch dimensions. |
| normalization | Which of the transform pair carries the scaling. A transform and its inverse undo one another whenever they are given the same one. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::rfft2 | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Transform a real array to the frequency domain.
Transforms along the last two axes and treats the rest as batch dimensions, which is how image data is usually laid out.
| x | The array to be transformed. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::rfft2 | ( | const_array_ref | x, |
| ops::fourier_normalization | normalization, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Transform a real array to the frequency domain.
Transforms along the last two axes and treats the rest as batch dimensions, which is how image data is usually laid out.
| x | The array to be transformed. |
| normalization | Which of the transform pair carries the scaling. A transform and its inverse undo one another whenever they are given the same one. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::rfft3 | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Transform a real array to the frequency domain.
Transforms along the last three axes and treats the rest as batch dimensions, which is how volume data is usually laid out.
| x | The array to be transformed. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::rfft3 | ( | const_array_ref | x, |
| ops::fourier_normalization | normalization, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Transform a real array to the frequency domain.
Transforms along the last three axes and treats the rest as batch dimensions, which is how volume data is usually laid out.
| x | The array to be transformed. |
| normalization | Which of the transform pair carries the scaling. A transform and its inverse undo one another whenever they are given the same one. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::right_shift | ( | const_array_ref | x, |
| const_array_ref | y, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Shift the bits of an array rightwards.
| x | The array whose bits are shifted. |
| y | The number of positions to shift by. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
|
noexcept |
Returns the input word with a bitwise rotation towards the left.
If the bit count is negative, it is equivalent to calling rotate_right(x, -s).
If the bit count is larger than the size of the word, it repeats cyclically.
| T | unsigned type |
| x | The input word |
| s | Number of bits to be shifted |
|
noexcept |
Returns the input word with a bitwise rotation towards the right.
If the bit count is negative, it is equivalent to calling rotate_left(x, -s)
If the bit count is larger than the size of the word, it repeats cyclically.
| T | unsigned type |
| x | The input word |
| s | Number of bits to be shifted |
| array rexlib::round | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Round the elements of an array to the nearest integer.
| x | The array to be rounded. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| std::size_t rexlib::sanitize_index | ( | std::ptrdiff_t | index, |
| std::size_t | extent | ||
| ) |
Ensure that the index is within bounds for a given extent.
This function ensures that the input index is within bounds for the provided axis extent. In addition, it replaces negative values with indices referred from the end of the array.
| index | Index to be checked. |
| extent | Extent of the indexed axis. |
| std::out_of_range | if the provided index is out of [-extent, extent) |
Sanitize a slice to ensure it is valid and within bounds for a given extent.
When end() is provided as count, it computes and replaces it by the actual element count.
| slice | Slice to be sanitized. |
| extent | Extent of the axis to which the slice applies. |
| std::out_of_range | If the slice is invalid or out of bounds. |
| std::invalid_argument | If the slice step is zero. |
| T rexlib::scalar_value_cast | ( | const scalar_value & | value | ) |
Convert the value held by a scalar_value into a concrete type.
Unlike get<T>(), which requires the requested type to match the stored one exactly, this dispatches on the stored numerical type and returns the value converted to T following numerical_cast's conversion rules.
| T | Destination type. Must be one of the numerical_type native types. |
| value | The scalar value to convert. |
| std::bad_cast | if the stored value's type can not be converted into T (e.g. a complex value into a real type). |
|
noexcept |
Assign a numeric affinity score for device use to a memory kind.
Higher values indicate memory that is more suitable for device access. Kinds that are fully device-local (e.g. device_local) receive the highest scores, while kinds that reside on the host and cannot be accessed from the device (e.g. host) receive the lowest ones.
| kind | Memory resource kind to be scored. |
0 if the memory kind is not device-accessible or kind is invalid.
|
noexcept |
Assign a numeric affinity score for host use to a memory kind.
Higher values indicate memory that is more suitable for host access. Kinds that are fully host-local (e.g. host) receive the highest scores, while kinds that reside on the device and cannot be accessed from the host (e.g. device_local) receive the lowest ones.
| kind | Memory resource kind to be scored. |
0 if the memory kind is not host-accessible or kind is invalid.
|
noexcept |
Sets the lowest '0' bit to '1' in place.
When there are no bits to be set (because all are '1'-s) it does not have any effect
| T | unsigned type |
| x | The input/output word |
| array rexlib::sign | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise sign of an array.
| x | The array whose sign is computed. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::sign_bit | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Test element-wise whether the sign bit of an array is set.
| x | The array to be tested. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::sin | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise sine of an array.
| x | The array whose sine is computed. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| std::pair< array, array > rexlib::sincos | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | sine = nullptr, |
||
| array * | cosine = nullptr |
||
| ) |
Compute the element-wise sine and cosine of an array at once.
Cheaper than calling sin and cos in turn, the two sharing the argument reduction that dominates their cost. Rotations and projections need both.
| x | The array whose sine and cosine are computed. |
| context | The execution context used for dispatching. |
| sine | Optional output parameter to be re-used. |
| cosine | Optional output parameter to be re-used. |
| array rexlib::sinh | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise hyperbolic sine of an array.
| x | The array whose hyperbolic sine is computed. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::split_key | ( | const_array_ref | key, |
| std::size_t | count, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Derive a sequence of keys from every key.
| key | The uint64 keys. |
| count | The number of keys derived from every key. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
key followed by one axis of count elements.| array rexlib::sqrt | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise square root of an array.
| x | The array whose square root is computed. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::square | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise square of an array.
| x | The array whose square is computed. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::subarray | ( | array & | input, |
| span< const dynamic_subscript > | subscripts | ||
| ) |
Obtain a view of a rectangular part of an array.
The result shares the storage of input and describes it through the layout that subscripts selects, so writing through the result writes through input. Nothing is allocated and no element is touched: this is a reinterpretation of the extents, the strides and the offset, which is why it needs neither an execution context nor an output parameter.
The subscripts are the same ones strided_layout::apply_subscripts accepts, so an axis may be indexed away, sliced with a step, kept whole with ellipsis_tag or introduced with new_axis_tag. Axes left unaddressed are kept whole, so fewer subscripts than the array has axes views the remaining ones in full.
| input | The array to view into. Its storage outlives the result, which shares ownership of it. |
| subscripts | The subscripts selecting the part of interest. |
input. | std::invalid_argument | If input is not initialized or if there are more subscripts than the array has axes. |
| std::out_of_range | If a subscript falls outside its axis. |
| const_array rexlib::subarray | ( | const_array_ref | input, |
| span< const dynamic_subscript > | subscripts | ||
| ) |
Obtain a read-only view of a rectangular part of an array.
Behaves as the non-const overload, except that the result only allows reading. It accepts anything a const_array_ref accepts, so it is also the overload chosen for a const array.
| input | The array to view into. Its storage outlives the result, which shares ownership of it. |
| subscripts | The subscripts selecting the part of interest. |
input. | std::invalid_argument | If input is not initialized or if there are more subscripts than the array has axes. |
| std::out_of_range | If a subscript falls outside its axis. |
| array rexlib::subtract | ( | const_array_ref | x, |
| const_array_ref | y, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise difference of two arrays.
The inputs must be broadcast-compatible and share the same numerical type. When out is null, the shape and type of the result are deduced from the (broadcast) inputs.
| x | The array to be subtracted from. |
| y | The array to subtract. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::sum | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Sum the elements of an array over every axis.
| x | The array to be reduced. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::sum | ( | const_array_ref | x, |
| span< const std::ptrdiff_t > | axes, | ||
| bool | keep_dimensions, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Sum the elements of an array along the given axes.
| x | The array to be reduced. |
| axes | The axes to reduce over. Negative values refer to axes from the end. An empty list reduces over no axis; call the overload without it to reduce over every one. |
| keep_dimensions | Whether the reduced axes are kept with an extent of one instead of being dropped. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::tan | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise tangent of an array.
| x | The array whose tangent is computed. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::tanh | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Compute the element-wise hyperbolic tangent of an array.
| x | The array whose hyperbolic tangent is computed. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| REXLIB_NORETURN void rexlib::throw_unexpected_operation | ( | const operation & | got, |
| const char * | expected | ||
| ) |
Report an operation that is not of the expected type, which has no static description.
| got | The operation that was passed. |
| expected | Name of the type that was expected. |
| std::invalid_argument | Always. |
| REXLIB_NORETURN void rexlib::throw_unexpected_operation | ( | const operation & | got, |
| const operation_descriptor & | expected | ||
| ) |
Report an operation that is not of the expected type.
| got | The operation that was passed. |
| expected | Description of the operation that was expected. |
| std::invalid_argument | Always. |
| array rexlib::to_device | ( | array & | input, |
| const execution_context & | context | ||
| ) |
Transfer an array from host to device memory.
If the array is already device-accessible, this operation returns an alias of the input array. Otherwise it behaves like to_device_copy
| input | Array to be transferred. |
| context | The execution environment. |
| array rexlib::to_device_copy | ( | const_array_ref | input, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Transfer an array to device memory enforcing a copy.
| input | Array to be transferred. |
| context | The execution environment. |
| out | Optional array to reuse. If provided, its resources may be re-used and it will be overwritten with the newly created array. |
| array rexlib::to_host | ( | array & | input, |
| const execution_context & | context | ||
| ) |
Transfer an array to host accessible memory.
If the array is already host-accessible, this operation returns an alias of the input array. Otherwise it behaves like to_host_copy
| input | Array to be transferred. |
| context | The execution environment. |
| array rexlib::to_host_copy | ( | const_array_ref | input, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Transfer an array to host accessible memory enforcing a copy.
| input | Array to be transferred. |
| context | The execution environment. |
| out | Optional array to reuse. If provided, its resources may be re-used and it will be overwritten with the newly created array. |
|
noexcept |
Get a human readable representation of a rule status.
| status | The status. |
| array rexlib::transfer | ( | array & | input, |
| memory_resource_affinity | affinity, | ||
| const execution_context & | context | ||
| ) |
Transfer an array to memory with the requested affinity.
If the array is already accessible from a memory resource with the requested affinity, this operation returns an alias of the input array. Otherwise it behaves like transfer_copy.
| input | Array to be transferred. |
| affinity | Affinity of the memory resource to transfer the array to. |
| context | The execution environment. |
| array rexlib::transfer_copy | ( | const_array_ref | input, |
| memory_resource_affinity | affinity, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Transfer an array to memory with the requested affinity enforcing a copy.
Unlike transfer, this operation always allocates fresh storage and copies the input into it, so the result never aliases the input.
| input | Array to be transferred. |
| affinity | Affinity of the memory resource to transfer the array to. |
| context | The execution environment. |
| out | Optional array to reuse. If provided, its resources may be re-used and it will be overwritten with the newly created array. |
| array rexlib::trunc | ( | const_array_ref | x, |
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Round the elements of an array towards zero.
| x | The array to be rounded. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::vecdot | ( | const_array_ref | x, |
| const_array_ref | y, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Contract two arrays along their last axis.
| x | The first array. |
| y | The second array. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::vecdot | ( | const_array_ref | x, |
| const_array_ref | y, | ||
| std::ptrdiff_t | axis, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Contract two arrays along one axis, broadcasting the rest.
| x | The first array. |
| y | The second array. |
| axis | The axis to contract along. Negative values refer to axes from the end. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::vecmat | ( | const_array_ref | x, |
| const_array_ref | y, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Multiply a stack of vectors by a stack of matrices.
| x | The stack of vectors. |
| y | The stack of matrices. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
x must already have rank one or more and y rank two or more.| REXLIB_CONSTEXPR auto rexlib::visit | ( | F && | func, |
| const dynamic_subscript & | subscript | ||
| ) |
Invoke the provided function with the value held by the dynamic subscript.
| F | Function type. |
| func | The function to be invoked. Must be callable with the following argument types:
|
| subscript | The subscript to be evaluated. |
Access the value held by a scalar_value with its concrete type.
Dispatches on the stored numerical type and calls the provided functor with a const reference to the value, statically typed as the corresponding C++ type. This allows accessing the value in a type-safe manner without knowing its type in advance.
The argument order mirrors std::visit: the visitor comes first.
| Func | Functor type, callable with any of the native scalar types. |
| func | Functor to be called with the stored value. |
| value | The scalar value to be visited. |
| array rexlib::where | ( | const_array_ref | condition, |
| const_array_ref | x, | ||
| const_array_ref | y, | ||
| const execution_context & | context, | ||
| array * | out = nullptr |
||
| ) |
Select element-wise between two arrays according to a condition.
| condition | The boolean array selecting between the other two. |
| x | The array selected where the condition holds. |
| y | The array selected where it does not. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| array rexlib::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.
| descriptor | Describes the shape and data type of the array. |
| affinity | Affinity used to select the memory resource where the array is allocated. |
| context | The execution context used for dispatching. |
| out | Optional output parameter to be re-used. |
| REXLIB_INLINE_CONST_CONSTEXPR std::size_t rexlib::max_extent_pivot_count = 8 |
Maximum number of extent variables a shape rule may declare.
Bounded so that a resolved rule stays an allocation free value on the dispatch path. Realistic rules use up to three.
| REXLIB_INLINE_CONST_CONSTEXPR std::size_t rexlib::max_type_pivot_count = 8 |
Maximum number of free variables a typing rule may declare.
Bounded so that a resolved rule stays a trivially copyable, allocation free value on the dispatch path. Realistic rules use one or two pivots.