|
rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
|
Interface deciding the shape and data type of the operands of an operation. More...
#include <rexlib/core/operation/operation_signature.hpp>
Public Member Functions | |
| operation_signature (const operation_signature &other)=delete | |
| operation_signature (operation_signature &&other)=delete | |
| operation_signature & | operator= (const operation_signature &other)=delete |
| operation_signature & | operator= (operation_signature &&other)=delete |
| virtual void | deduce (const operation_descriptor &descriptor, span< operand_specification > canonical_outputs, span< const operand_specification > inputs) const =0 |
| Compute the output operands the inputs call for. | |
| virtual void | accept (const operation_descriptor &descriptor, span< const operand_specification > user_outputs, span< const operand_specification > inputs) const =0 |
| Decide whether output operands supplied in advance are admissible. | |
| virtual operation_arity | get_arity () const noexcept=0 |
| Get the number of output and input operands. | |
Interface deciding the shape and data type of the operands of an operation.
The signature has two roles:
deduce computes the output operands the inputs call for, and checks the inputs along the way.accept decides whether output operands supplied in advance are admissible for the inputs.It works on operand_specification values, which hold a shape and a data type, not on the operand_descriptor a program is built against, which also holds a memory layout and resource.
|
pure virtual |
Decide whether output operands supplied in advance are admissible.
| descriptor | Description of the operation, used to name the operation and its operands when reporting a rejection. |
| user_outputs | The output operands supplied in advance. |
| inputs | The input operands. |
| std::invalid_argument | When an output is not admissible. |
| std::out_of_range | When the signature names an axis beyond the rank of the operands. |
Implemented in rexlib::rule_signature< ShapeRule, TypeRule, Parameters >, and rexlib::rule_signature< shape_rule_type, type_rule_type, parameters_type >.
|
pure virtual |
Compute the output operands the inputs call for.
A data type the inputs do not determine is left as numerical_type::unknown, for an output supplied in advance to fix.
| descriptor | Description of the operation, used to name the operation and its operands when reporting a rejection. |
| canonical_outputs | Output buffer, sized to the operation's output arity. |
| inputs | The input operands. |
| std::invalid_argument | When the inputs are not admissible. |
| std::out_of_range | When the signature names an axis beyond the rank of the operands. |
Implemented in rexlib::rule_signature< ShapeRule, TypeRule, Parameters >, and rexlib::rule_signature< shape_rule_type, type_rule_type, parameters_type >.
|
pure virtualnoexcept |
Get the number of output and input operands.
deduce and accept take. Implemented in rexlib::rule_signature< ShapeRule, TypeRule, Parameters >, and rexlib::rule_signature< shape_rule_type, type_rule_type, parameters_type >.