|
rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
|
Specification of work to be executed on a command_queue. More...
#include <rexlib/core/hardware/command.hpp>
Public Member Functions | |
| command () noexcept | |
| Construct a command with no program and empty bindings. | |
| command (std::shared_ptr< const program > program) noexcept | |
| Construct a command associated with the given program. | |
| command (const command &other) | |
| command (command &&other) noexcept | |
| command & | operator= (const command &other) |
| command & | operator= (command &&other) noexcept |
| command & | bind_outputs (std::vector< std::shared_ptr< buffer > > outputs) noexcept |
| Bind the output buffers for this command. | |
| command & | bind_inputs (std::vector< std::shared_ptr< const buffer > > inputs) noexcept |
| Bind the input buffers for this command. | |
| command & | bind_scratch (std::vector< std::shared_ptr< buffer > > scratch) noexcept |
| Bind the scratch buffers for this command. | |
| command & | bind_dependencies (std::vector< command_token > dependencies) noexcept |
| Bind the commands this command has to run after. | |
| const std::shared_ptr< const program > & | get_program () const noexcept |
| Get the program associated with this command. | |
| span< const std::shared_ptr< buffer > > | get_outputs () const noexcept |
| Get the bound output buffers. | |
| span< const std::shared_ptr< const buffer > > | get_inputs () const noexcept |
| Get the bound input buffers. | |
| span< const std::shared_ptr< buffer > > | get_scratch () const noexcept |
| Get the bound scratch buffers. | |
| span< const command_token > | get_dependencies () const noexcept |
| Get the bound dependencies. | |
Specification of work to be executed on a command_queue.
A command binds a program to its operands (outputs, inputs, and scratch buffers) and to the commands it has to run after, and is passed to command_queue::submit for execution. It offers a fluent interface for binding them, allowing the binding calls to be chained in a single expression.
A command owns what is bound to it. The buffers and the tokens stay alive for as long as the command does.
Construct a command associated with the given program.
Bindings are initially empty; use bind_outputs, bind_inputs, bind_scratch and bind_dependencies to populate them before submission.
| program | The program to execute. May be nullptr, but command_queue::submit requires a non-null program. |
|
noexcept |
Bind the commands this command has to run after.
Replaces the dependencies bound before.
| dependencies | Tokens of the commands to run after. May be empty. An empty token is allowed and adds nothing. |
*this to allow method chaining.
|
noexcept |
Bind the input buffers for this command.
Replaces the input buffers bound before.
| inputs | The input buffer handles. May be empty. |
*this to allow method chaining.
|
noexcept |
Bind the output buffers for this command.
Replaces the output buffers bound before.
| outputs | The output buffer handles. May be empty. |
*this to allow method chaining.
|
noexcept |
Bind the scratch buffers for this command.
Scratch buffers provide temporary workspace required by the program (see program::get_scratch_requirements). They must be bound in the same order as the requirements returned by that method.
Replaces the scratch buffers bound before.
| scratch | The scratch buffer handles. May be empty if the program has no scratch requirements. |
*this to allow method chaining.
|
noexcept |
Get the bound dependencies.
Get the bound input buffers.
Get the bound output buffers.
Get the program associated with this command.
nullptr if no program was set. Get the bound scratch buffers.