|
rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
|
Abstract interface that executes operations on a set of operands. More...
#include <rexlib/core/dispatch/dispatcher.hpp>
Public Member Functions | |
| dispatcher (const dispatcher &other)=delete | |
| dispatcher (dispatcher &&other)=delete | |
| dispatcher & | operator= (const dispatcher &other)=delete |
| dispatcher & | operator= (dispatcher &&other)=delete |
| 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 interface that executes operations on a set of operands.
A dispatcher takes the immutable description of an operation together with its input and output operands and turns it into work submitted to a device. It owns whatever machinery is required to select and build an executable program for the operation (e.g. an operation program manager and a cache of backend-private resources), so that callers only need to provide the operands and the hardware resources on which the work is to be carried out.
Different implementations may realize different execution strategies, such as eager submission or deferred graph building.
|
pure virtual |
Execute an operation on the provided operands.
Output operands are resolved against the operation: when they lack storage it is allocated from the allocators of device, and when they already own storage it is validated and reused. The resulting command is then submitted to the active queue of device.
The work runs after the commands that still access its operands: those that write an input, and those that read or write an output. It is then recorded on the operands itself.
| operation | The operation to be executed. |
| output_operands | The output operands. May be modified in place to receive freshly allocated storage and sanitized descriptors. |
| input_operands | The input operands. Must already own storage. |
| device | The allocators and the active queue the operation runs with. |