rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
Loading...
Searching...
No Matches
Public Member Functions | List of all members
rexlib::operation_signature Class Referenceabstract

Interface deciding the shape and data type of the operands of an operation. More...

#include <rexlib/core/operation/operation_signature.hpp>

Inheritance diagram for rexlib::operation_signature:
rexlib::rule_signature< shape_rule_type, type_rule_type, parameters_type > rexlib::rule_signature< ShapeRule, TypeRule, Parameters >

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.
 

Detailed Description

Interface deciding the shape and data type of the operands of an operation.

The signature has two roles:

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.

Member Function Documentation

◆ accept()

virtual void rexlib::operation_signature::accept ( const operation_descriptor &  descriptor,
span< const operand_specification >  user_outputs,
span< const operand_specification >  inputs 
) const
pure virtual

Decide whether output operands supplied in advance are admissible.

Parameters
descriptorDescription of the operation, used to name the operation and its operands when reporting a rejection.
user_outputsThe output operands supplied in advance.
inputsThe input operands.
Exceptions
std::invalid_argumentWhen an output is not admissible.
std::out_of_rangeWhen 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 >.

◆ deduce()

virtual void rexlib::operation_signature::deduce ( const operation_descriptor &  descriptor,
span< operand_specification >  canonical_outputs,
span< const operand_specification >  inputs 
) const
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.

Parameters
descriptorDescription of the operation, used to name the operation and its operands when reporting a rejection.
canonical_outputsOutput buffer, sized to the operation's output arity.
inputsThe input operands.
Exceptions
std::invalid_argumentWhen the inputs are not admissible.
std::out_of_rangeWhen 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 >.

◆ get_arity()

virtual operation_arity rexlib::operation_signature::get_arity ( ) const
pure virtualnoexcept

Get the number of output and input operands.

Returns
operation_arity The operand counts deduce and accept take.

Implemented in rexlib::rule_signature< ShapeRule, TypeRule, Parameters >, and rexlib::rule_signature< shape_rule_type, type_rule_type, parameters_type >.


The documentation for this class was generated from the following file: