rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
Loading...
Searching...
No Matches
execution_context.hpp
1// SPDX-License-Identifier: GPL-3.0-only
2
3#pragma once
4
5#include "dispatcher.hpp"
6
7#include <rexlib/core/platform/dynamic_shared_object.h>
8#include <rexlib/core/hardware/device_context.hpp>
9
10#include <memory>
11
12namespace rexlib
13{
14
15
43{
44public:
51 REXLIB_API
53
61 REXLIB_API
64 std::shared_ptr<dispatcher> dispatcher
65 );
66
67 REXLIB_API
69 REXLIB_API
70 execution_context(execution_context &&other) noexcept;
71 REXLIB_API
73
74 REXLIB_API
75 execution_context& operator=(const execution_context &other);
76 REXLIB_API
77 execution_context& operator=(execution_context &&other) noexcept;
78
84 REXLIB_API
85 const device_context&
86 get_device_context() const noexcept;
87
94 REXLIB_API
95 const std::shared_ptr<dispatcher>&
96 get_dispatcher() const noexcept;
97
112 REXLIB_API
115 ) const;
116
124 REXLIB_API
126 std::shared_ptr<dispatcher> dispatcher
127 ) const;
128
129private:
130 device_context m_device_context;
131 std::shared_ptr<dispatcher> m_dispatcher;
132};
133
134} // namespace rexlib
Scoped, configurable view over a device_session.
Definition device_context.hpp:49
Abstract interface that executes operations on a set of operands.
Definition dispatcher.hpp:38
Pairs the hardware resources and the dispatch strategy used to run operations.
Definition execution_context.hpp:43
const std::shared_ptr< dispatcher > & get_dispatcher() const noexcept
Retrieve the dispatcher used to execute operations.
execution_context() noexcept
Construct an empty execution context.
execution_context with_device_context(device_context device_context) const
Derive an execution context with a different device context.
execution_context with_dispatcher(std::shared_ptr< dispatcher > dispatcher) const
Derive an execution context with a different dispatcher.
const device_context & get_device_context() const noexcept
Retrieve the device context describing where operations execute.
Arrays, the operations on them and the devices that run those operations.
Definition cpu_device.hpp:10