rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
Loading...
Searching...
No Matches
fill_operation.hpp
1// SPDX-License-Identifier: GPL-3.0-only
2
3#pragma once
4
5#include <rexlib/core/numerical/scalar_value.hpp>
6#include <rexlib/core/operation/operation_declaration_macros.hpp>
7#include <rexlib/core/platform/dynamic_shared_object.h>
8#include <rexlib/ops/ops_component.hpp>
9#include <rexlib/ops/rules/shape_rules.hpp>
10#include <rexlib/ops/rules/type_rules.hpp>
11
12namespace rexlib
13{
14namespace ops
15{
16
17REXLIB_DECLARE_OPERATION_TRAITS(
18 fill,
19 ops_component,
20 REXLIB_OPERANDS("destination"),
21 REXLIB_OPERANDS(),
23 nullary_free_rule<>
24);
25
32REXLIB_BEGIN_TEMPLATE_BASE
34 : public trivial_operation<fill_operation, fill_operation_traits>
35{
36public:
42 explicit fill_operation(const scalar_value &fill_value) noexcept;
43
50
53 scalar_value m_fill_value;
54};
56
57} // namespace ops
58} // namespace rexlib
Container for multidimensional numeric data.
Definition array.hpp:31
Fill an array with a constant value.
Definition fill_operation.hpp:35
const scalar_value & get_fill_value() const noexcept
Get the fill value.
fill_operation(const scalar_value &fill_value) noexcept
Construct a fill operation by the value used to fill.
Owns a copy of a dynamically typed scalar value.
Definition scalar_value.hpp:35
CRTP base for operations that are trivially declared.
Definition trivial_operation.hpp:34
operand_shape_rule< type_list<>, type_list< core_dimensions<> >, type_list<>, trailing_core, output_batch::broadcast_target > nullary_elementwise_shape_rule
Operation without operands to read that writes into the outputs it is handed, whatever their shape.
Definition shape_rules.hpp:51
Arrays, the operations on them and the devices that run those operations.
Definition cpu_device.hpp:10
void fill(array &out, const scalar_value &fill_value, const execution_context &context)
Set all the elements of an array to a given value.