rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
Loading...
Searching...
No Matches
command_token.hpp
1// SPDX-License-Identifier: GPL-3.0-only
2
3#pragma once
4
5#include <rexlib/core/platform/dynamic_shared_object.h>
6
7#include <cstddef>
8#include <memory>
9
10namespace rexlib
11{
12
13class command_timeline;
14
27{
28public:
32 REXLIB_API
33 command_token() noexcept;
34
42 REXLIB_API
44 std::shared_ptr<const command_timeline> timeline,
45 std::size_t id
46 ) noexcept;
47
48 REXLIB_API
49 command_token(const command_token &other) noexcept;
50 REXLIB_API
51 command_token(command_token &&other) noexcept;
52 REXLIB_API
54
55 REXLIB_API
56 command_token& operator=(const command_token &other) noexcept;
57 REXLIB_API
58 command_token& operator=(command_token &&other) noexcept;
59
65 REXLIB_API
66 const std::shared_ptr<const command_timeline>&
67 get_timeline() const noexcept;
68
74 REXLIB_API
75 std::size_t get_id() const noexcept;
76
83 REXLIB_API
84 bool is_empty() const noexcept;
85
94 REXLIB_API
95 bool is_complete() const;
96
102 REXLIB_API
103 void wait() const;
104
105private:
106 std::shared_ptr<const command_timeline> m_timeline;
107 std::size_t m_id;
108};
109
110} // namespace rexlib
Tells the host which commands of a queue have finished.
Definition command_timeline.hpp:23
Identifies a command submitted to a command_queue.
Definition command_token.hpp:27
void wait() const
Block the calling thread until the command has finished.
std::size_t get_id() const noexcept
Get the id of the command in its timeline.
bool is_complete() const
Check whether the command has finished.
command_token() noexcept
Construct an empty token.
bool is_empty() const noexcept
Check whether this is empty.
const std::shared_ptr< const command_timeline > & get_timeline() const noexcept
Get the timeline that gave the id.
Arrays, the operations on them and the devices that run those operations.
Definition cpu_device.hpp:10