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 Class Reference

Abstract representation of an executable program. More...

#include <rexlib/core/hardware/program.hpp>

Inheritance diagram for rexlib::program:
rexlib::cpu::cpu_program

Public Member Functions

 program (const program &other)=delete
 
 program (program &&other)=delete
 
program & operator= (const program &other)=delete
 
program & operator= (program &&other)=delete
 
virtual span< const program_scratch_requirement > get_scratch_requirements () const
 Queries the scratch buffer requirements for this program.
 

Detailed Description

Abstract representation of an executable program.

A program is a passive and backend-specific descriptor of work to be executed on a device. Execution is driven by command_queue::submit, which records the program on a queue together with its operands.

Each concrete program instance is bound to the device it was created for and may only be submitted to queues belonging to that device.

Member Function Documentation

◆ get_scratch_requirements()

virtual span< const program_scratch_requirement > rexlib::program::get_scratch_requirements ( ) const
virtual

Queries the scratch buffer requirements for this program.

The program may require temporary (scratch) memory buffers for execution. This method returns a view over the scratch buffer requirements for this program, allowing the caller to allocate the necessary buffers before program submission. The view remains valid and stable during the lifetime of the object.

If the returned list is empty, the program requires no scratch buffers and scratch does not need to be bound in execution. Otherwise, scratch binding in command must contain one buffer for each requirement in the order returned. Each buffer must have a size >= the corresponding requirement's size and alignment >= the requirement's alignment. Contents are undefined on entry and on completion, so callers must not store persistent data in them and may reuse the same buffers for multiple programs as long as their executions do not overlap.

Returns an empty span by default (no scratch required).

Returns
A non-owning view of the scratch buffer requirements.
See also
program_scratch_requirement for details on individual requirement specifications.

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