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_builder Class Referenceabstract

Abstract representation of a factory class for operation programs. More...

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

Inheritance diagram for rexlib::program_builder:
rexlib::cpu::cpu_program_builder

Public Member Functions

 program_builder (const program_builder &other)=delete
 
 program_builder (program_builder &&other)=delete
 
program_builder & operator= (const program_builder &other)=delete
 
program_builder & operator= (program_builder &&other)=delete
 
virtual operation_id get_operation_id () const noexcept=0
 Get the operation identifier for which this builder is specialized.
 
virtual backend_priority get_suitability (const operation &operation, span< const operand_descriptor > output_descriptors, span< const operand_descriptor > input_descriptors, command_queue &queue) const =0
 Get the suitability of this builder for a given launch configuration.
 
virtual 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) const =0
 Build an executable operation program for a given launch configuration.
 

Detailed Description

Abstract representation of a factory class for operation programs.

Member Function Documentation

◆ build()

virtual std::shared_ptr< program > rexlib::program_builder::build ( const operation &  operation,
span< const operand_descriptor >  output_descriptors,
span< const operand_descriptor >  input_descriptors,
command_queue &  queue,
program_cache *  cache 
) const
pure virtual

Build an executable operation program for a given launch configuration.

This method may not be called if get_suitability() returns backend_priority::unsupported.

Parameters
operationThe operation. Its ID must be equal to the ID returned by get_operation_id.
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. When not null, the builder may consult and update it to reuse expensive resources (FFT plans, compiled kernels, workspaces, ...) across builds. Implementations are free to ignore it.
Returns
std::shared_ptr<program> The executable program suited for the requested operation and operand descriptors.

◆ get_operation_id()

virtual operation_id rexlib::program_builder::get_operation_id ( ) const
pure virtualnoexcept

Get the operation identifier for which this builder is specialized.

Returns
operation_id The operation ID.

◆ get_suitability()

virtual backend_priority rexlib::program_builder::get_suitability ( const operation &  operation,
span< const operand_descriptor >  output_descriptors,
span< const operand_descriptor >  input_descriptors,
command_queue &  queue 
) const
pure virtual

Get the suitability of this builder for a given launch configuration.

Parameters
operationThe operation. Its ID must be equal to the ID returned by get_operation_id.
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.
Returns
backend_priority The suitability of this builder for the requested launch configuration.

Implemented in rexlib::cpu::cpu_program_builder.


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