|
rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
|
CRTP base for operations whose signature depends on parameters. More...
#include <rexlib/core/operation/parametric_operation.hpp>
Public Types | |
| using | parameters_type = typename Traits::parameters_type |
| using | signature_type = rule_signature< shape_rule_type, type_rule_type, parameters_type > |
Public Types inherited from rexlib::basic_operation< Derived, Traits > | |
| using | traits_type = Traits |
| using | shape_rule_type = typename Traits::shape_rule_type |
| using | type_rule_type = typename Traits::type_rule_type |
Public Member Functions | |
| template<typename... Args, typename = typename std::enable_if< std::is_constructible<parameters_type, Args...>::value >::type> | |
| parametric_operation (Args &&... args) | |
| Construct the operation by constructing its parameters. | |
| const parameters_type & | get_parameters () const noexcept |
| Get the parameters of the operation. | |
| const operation_signature & | get_signature () const noexcept override |
| Get the signature deciding the shape and data type of the operands of this operation. | |
Public Member Functions inherited from rexlib::basic_operation< Derived, Traits > | |
| const operation_descriptor & | get_descriptor () const noexcept override |
| Get the description of this operation. | |
| operation_id | get_id () const noexcept override |
Get the identifier of Derived. | |
Public Member Functions inherited from rexlib::operation | |
| operation (const operation &other)=delete | |
| operation (operation &&other)=delete | |
| operation & | operator= (const operation &other)=delete |
| operation & | operator= (operation &&other)=delete |
Additional Inherited Members | |
Static Public Member Functions inherited from rexlib::basic_operation< Derived, Traits > | |
| static const operation_descriptor & | get_static_descriptor () noexcept |
| Get the description shared by every instance. | |
Static Public Attributes inherited from rexlib::basic_operation< Derived, Traits > | |
| static REXLIB_CONST_CONSTEXPR std::size_t | output_operand_count |
| static REXLIB_CONST_CONSTEXPR std::size_t | input_operand_count |
CRTP base for operations whose signature depends on parameters.
Owns a rule_signature holding the parameters of the operation and forwards every constructor argument to them, so an operation whose signature reads its parameters, such as a reduction over a set of axes, needs no body of its own. The parameters are checked against the rules on construction.
Only parameters the signature reads are covered. An operation carrying a value its signature does not read declares that value itself, as fill_operation does.
The signature is not copyable, so the operation is not either.
| Derived | The concrete operation type. |
| Traits | The static description. In addition to what basic_operation requires, it must provide using parameters_type = ... naming the type of the parameters, and its rules must read them. |
|
explicit |
Construct the operation by constructing its parameters.
Constrained on the parameters being constructible from args, so that a wrong argument list is reported as no matching constructor rather than as an error inside the parameters, and so that this constructor does not take part in copy initialization.
| Args | Constructor argument types of the parameters. |
| args | Forwarded to the parameters. |
| std::invalid_argument | When the rules do not admit the parameters. |
|
noexcept |
Get the parameters of the operation.
How a program builder reads them back. A builder is instantiated on the operation type, so it recovers the operation with operation_cast and never has to downcast the erased signature.
|
overridevirtualnoexcept |
Get the signature deciding the shape and data type of the operands of this operation.
Implements rexlib::operation.