rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
Loading...
Searching...
No Matches
dispatcher.hpp
1// SPDX-License-Identifier: GPL-3.0-only
2
3#pragma once
4
5#include "../platform/dynamic_shared_object.h"
6#include "../span.hpp"
7
8#include <memory>
9
10namespace rexlib
11{
12
13
14class device_context;
15
16
17class array;
18class const_array_ref;
19
20
21class operation;
22class program_manager;
23
37class REXLIB_API dispatcher
38{
39public:
40 dispatcher() noexcept;
41 dispatcher(const dispatcher &other) = delete;
42 dispatcher(dispatcher &&other) = delete;
43 virtual ~dispatcher();
44
46 operator=(const dispatcher &other) = delete;
48 operator=(dispatcher &&other) = delete;
49
71 virtual void dispatch(
72 const operation &operation,
73 span<array> output_operands,
74 span<const const_array_ref> input_operands,
76 ) = 0;
77};
78
93REXLIB_API
94std::shared_ptr<dispatcher> make_eager_dispatcher(
95 std::shared_ptr<const program_manager> program_manager
96);
97
98} // namespace rexlib
Scoped, configurable view over a device_session.
Definition device_context.hpp:49
Abstract representation of a hardware compute device.
Definition device.hpp:26
Abstract interface that executes operations on a set of operands.
Definition dispatcher.hpp:38
virtual void dispatch(const operation &operation, span< array > output_operands, span< const const_array_ref > input_operands, const device_context &device)=0
Execute an operation on the provided operands.
Abstract class that describes an operation.
Definition operation.hpp:23
Centralizes all known instances of operation program builders.
Definition program_manager.hpp:32
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
std::shared_ptr< dispatcher > make_eager_dispatcher(std::shared_ptr< const program_manager > program_manager)
Create a dispatcher that submits operations eagerly.
@ operation
Supplied by the operation instance.