rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
Loading...
Searching...
No Matches
program_builder.hpp
1// SPDX-License-Identifier: GPL-3.0-only
2
3#pragma once
4
5#include <rexlib/core/operation/operation_id.hpp>
6
7#include "../platform/dynamic_shared_object.h"
8#include "../span.hpp"
9#include "../numerical/numerical_type.hpp"
10#include "../backend_priority.hpp"
11
12#include <memory>
13
14namespace rexlib
15{
16
17class program;
18class command_queue;
19
20
21class operation;
22class operand_descriptor;
23class program_cache;
24
28class REXLIB_API program_builder
29{
30public:
31 program_builder() noexcept;
32 program_builder(const program_builder &other) = delete;
33 program_builder(program_builder &&other) = delete;
34 virtual ~program_builder();
35
37 operator=(const program_builder &other) = delete;
39 operator=(program_builder &&other) = delete;
40
47 virtual operation_id get_operation_id() const noexcept = 0;
48
64 virtual backend_priority get_suitability(
65 const operation &operation,
66 span<const operand_descriptor> output_descriptors,
67 span<const operand_descriptor> input_descriptors,
68 command_queue &queue
69 ) const = 0;
70
93 virtual
94 std::shared_ptr<program> build(
95 const operation &operation,
96 span<const operand_descriptor> output_descriptors,
97 span<const operand_descriptor> input_descriptors,
98 command_queue &queue,
99 program_cache *cache
100 ) const = 0;
101};
102
103} // namespace rexlib
Abstract command queue belonging to a device.
Definition command_queue.hpp:27
Logical representation of an operand's properties.
Definition operand_descriptor.hpp:29
Unique identification for an operation type.
Definition operation_id.hpp:16
Abstract class that describes an operation.
Definition operation.hpp:23
Abstract representation of a factory class for operation programs.
Definition program_builder.hpp:29
virtual operation_id get_operation_id() const noexcept=0
Get the operation identifier for which this builder is specialized.
Bounded associative store for backend-private resources reused across operation program builds.
Definition program_cache.hpp:42
Abstract representation of an executable program.
Definition program.hpp:27
Represents a non-owning area of contiguous memory.
Definition span.hpp:99
Arrays, the operations on them and the devices that run those operations.
Definition cpu_device.hpp:10
backend_priority
Enumeration defining the preference over the selection of a particular backend.
Definition backend_priority.hpp:20
@ operation
Supplied by the operation instance.