rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
Loading...
Searching...
No Matches
split_key_operation.hpp
1// SPDX-License-Identifier: GPL-3.0-only
2
3#pragma once
4
5#include <rexlib/core/numerical/numerical_type.hpp>
6#include <rexlib/core/numerical/numerical_type_domain_tags.hpp>
7#include <rexlib/core/operation/operation_declaration_macros.hpp>
8#include <rexlib/core/platform/dynamic_shared_object.h>
9#include <rexlib/ops/ops_component.hpp>
10#include <rexlib/ops/parameters/sequence_length.hpp>
11#include <rexlib/ops/rules/shape_rules.hpp>
12#include <rexlib/ops/rules/type_rules.hpp>
13
14#include <cstddef>
15
16namespace rexlib
17{
18namespace ops
19{
20
21REXLIB_DECLARE_PARAMETRIC_OPERATION_TRAITS(
23 ops_component,
24 REXLIB_OPERANDS("result"),
25 REXLIB_OPERANDS("key"),
27 sequence_length,
28 unary_homogeneous_rule<single_type_domain<numerical_type::uint64>>
29);
30
38REXLIB_BEGIN_TEMPLATE_BASE
40 : public parametric_operation<
41 split_key_operation,
42 split_key_operation_traits
43 >
44{
45public:
51 explicit split_key_operation(std::size_t count);
52
58 std::size_t get_count() const noexcept;
59};
61
62} // namespace ops
63} // namespace rexlib
Container for multidimensional numeric data.
Definition array.hpp:31
Derive a sequence of keys from every key.
Definition split_key_operation.hpp:44
split_key_operation(std::size_t count)
Construct a split of every key into a number of keys.
std::size_t get_count() const noexcept
Get the number of keys derived from every key.
CRTP base for operations whose signature depends on parameters.
Definition parametric_operation.hpp:43
operand_shape_rule< type_list< extent_from_operation< count_of > >, type_list< core_dimensions< axis_same_as< 0 > > >, type_list< core_dimensions<> > > elementwise_sequence_shape_rule
Sequence of as many values as the operation names for every element of the input.
Definition shape_rules.hpp:299
operand_type_rule< type_list< pivot_from_input< 0, Domain > >, type_list< slot_same_as< 0 > >, type_list< slot_same_as< 0 > > > unary_homogeneous_rule
Unary operation whose operands share one element type.
Definition type_rules.hpp:40
Arrays, the operations on them and the devices that run those operations.
Definition cpu_device.hpp:10
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.