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_manager.hpp
1// SPDX-License-Identifier: GPL-3.0-only
2
3#pragma once
4
5#include "../platform/dynamic_shared_object.h"
6#include "../service_manager.hpp"
7#include "../numerical/numerical_type.hpp"
8#include "../span.hpp"
9
10#include <memory>
11
12namespace rexlib
13{
14
15class program;
16class command_queue;
17
18
19class operation;
20class operand_descriptor;
21class program_builder;
22class program_cache;
23
30class REXLIB_API program_manager
31 : public service_manager
32{
33public:
34 program_manager() noexcept;
35 program_manager(const program_manager &other) = delete;
36 program_manager(program_manager &&other) = delete;
37 ~program_manager() override;
38
40 operator=(const program_manager &other) = delete;
42 operator=(program_manager &&other) = delete;
43
45
54 std::unique_ptr<program_builder> builder
55 );
56
75 std::shared_ptr<program> build(
76 const operation &operation,
77 span<const operand_descriptor> output_descriptors,
78 span<const operand_descriptor> input_descriptors,
79 command_queue &queue,
80 program_cache *cache = nullptr
81 ) const;
82
83private:
84 class implementation;
85 REXLIB_STD_MEMBER_INTERFACE
86 std::unique_ptr<implementation> m_implementation;
87
88 implementation& create_if_null();
89 const implementation& get_implementation() const noexcept;
90};
91
92} // namespace rexlib
Abstract command queue belonging to a device.
Definition command_queue.hpp:27
Abstract class that describes an operation.
Definition operation.hpp:23
Bounded associative store for backend-private resources reused across operation program builds.
Definition program_cache.hpp:42
Centralizes all known instances of operation program builders.
Definition program_manager.hpp:32
bool register_builder(std::unique_ptr< program_builder > builder)
Register a new operation program builder.
void register_builtin_backends() override
Register backends bundled with the core library.
std::shared_ptr< program > build(const operation &operation, span< const operand_descriptor > output_descriptors, span< const operand_descriptor > input_descriptors, command_queue &queue, program_cache *cache=nullptr) const
Build an executable operation program for a given launch configuration.
Abstract class defining the interface of a service manager.
Definition service_manager.hpp:23
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
@ operation
Supplied by the operation instance.