rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
Loading...
Searching...
No Matches
type_rule_interpreter.hpp
1// SPDX-License-Identifier: GPL-3.0-only
2
3#pragma once
4
5#include <rexlib/core/operation/type_rule/type_rule_descriptor.hpp>
6#include <rexlib/core/operation/type_rule/type_rule_resolution.hpp>
7
8#include <rexlib/core/numerical/numerical_type.hpp>
9#include <rexlib/core/operation/operand_specification.hpp>
10#include <rexlib/core/operation/operation_descriptor.hpp>
12#include <rexlib/core/platform/dynamic_shared_object.h>
13#include <rexlib/core/span.hpp>
14
15#include <cstddef>
16
17namespace rexlib
18{
19
151
152} // namespace rexlib
Macro definitions for supported attributes.
#define REXLIB_NORETURN
Indicates that the function does not return.
Definition attributes.hpp:32
Container for multidimensional numeric data.
Definition array.hpp:31
Immutable static description of an operation type.
Definition operation_descriptor.hpp:30
Type erased form of an operand_type_rule.
Definition type_rule_descriptor.hpp:19
Interpreter of a typing rule lowered to a descriptor.
Definition type_rule_interpreter.hpp:40
type_rule_resolution resolve(span< const numerical_type > operation_data_types, span< const numerical_type > output_types, span< const numerical_type > input_types) const noexcept
Resolve the rule against concrete operand data types.
void deduce(const operation_descriptor &descriptor, span< const numerical_type > operation_data_types, span< operand_specification > canonical_outputs, span< const operand_specification > inputs) const
Compute the data types of the outputs the inputs call for.
void accept(const operation_descriptor &descriptor, span< const numerical_type > operation_data_types, span< const operand_specification > user_outputs, span< const operand_specification > inputs) const
Decide whether outputs supplied in advance have admissible data types.
type_rule_interpreter(const type_rule_descriptor &rule) noexcept
Construct an interpreter of a rule.
REXLIB_NORETURN void throw_error(const operation_descriptor &descriptor, const type_rule_resolution &resolution) const
Turn a failed resolution into an exception.
void check_instance(const operation_descriptor &descriptor, span< const numerical_type > operation_data_types) const
Check the data types an operation instance supplies.
Resolved pivot values of a typing rule, or the reason it failed.
Definition type_rule_resolution.hpp:26
Arrays, the operations on them and the devices that run those operations.
Definition cpu_device.hpp:10
@ inputs
Bound by the input axes that name the variable.