rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
Loading...
Searching...
No Matches
Public Member Functions | List of all members
rexlib::program_manager Class Reference

Centralizes all known instances of operation program builders. More...

#include <rexlib/core/dispatch/program_manager.hpp>

Inheritance diagram for rexlib::program_manager:
rexlib::service_manager

Public Member Functions

 program_manager (const program_manager &other)=delete
 
 program_manager (program_manager &&other)=delete
 
program_manager & operator= (const program_manager &other)=delete
 
program_manager & operator= (program_manager &&other)=delete
 
void register_builtin_backends () override
 Register backends bundled with the core library.
 
bool register_builder (std::unique_ptr< program_builder > builder)
 Register a new operation program builder.
 
std::shared_ptr< program > build (const operation &operation, span< const operand_descriptor > output_descriptors, span< const operand_descriptor > input_descriptors, command_queue &queue, program_cache *cache=nullptr) const
 Build an executable operation program for a given launch configuration.
 
- Public Member Functions inherited from rexlib::service_manager
 service_manager (const service_manager &other)=delete
 
 service_manager (service_manager &&other)=delete
 
service_manager & operator= (const service_manager &other)=delete
 
service_manager & operator= (service_manager &&other)=delete
 

Detailed Description

Centralizes all known instances of operation program builders.

The operation program builders are cataloged by their intended operation such that it allows fast retrieval.

Member Function Documentation

◆ build()

std::shared_ptr< program > rexlib::program_manager::build ( const operation &  operation,
span< const operand_descriptor >  output_descriptors,
span< const operand_descriptor >  input_descriptors,
command_queue &  queue,
program_cache *  cache = nullptr 
) const

Build an executable operation program for a given launch configuration.

Parameters
operationThe operation for which the program is built.
output_descriptorsThe output operand descriptors involved in the operation.
input_descriptorsThe input operand descriptors involved in the operation.
queueThe command queue where the built program is intended to be used.
cacheOptional cache for backend-private resources, forwarded to the selected builder.
Returns
std::shared_ptr<program> The executable program suited for the requested operation and operand descriptors.
Exceptions
unsupported_operation_errorIf no registered builder supports the operation with these operand descriptors on this queue.

◆ register_builder()

bool rexlib::program_manager::register_builder ( std::unique_ptr< program_builder >  builder)

Register a new operation program builder.

Parameters
builderThe builder to be registered.
Returns
true The operation program builder was successfully registered.
false The operation program builder could not be registered.

◆ register_builtin_backends()

void rexlib::program_manager::register_builtin_backends ( )
overridevirtual

Register backends bundled with the core library.

This usually loads fallback implementations that are always available although they may not be the most efficient or performant. The loaded backend(s) depend on the implementation of the specific interface.

Reimplemented from rexlib::service_manager.


The documentation for this class was generated from the following file: