Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
uni20::async::LightweightTaskBatch Class Reference

Borrowed type-erased description of a synchronous lightweight task batch. More...

#include <scheduler.hpp>

Public Member Functions

void operator() (std::size_t index) const
 Execute one work item.
 
auto size () const noexcept -> std::size_t
 Return the number of independent work items.
 

Static Public Member Functions

template<class Function >
requires std::invocable<Function&, std::size_t>
static auto bind (std::size_t size, Function &function) -> LightweightTaskBatch
 Bind a callable for the duration of one synchronous batch call.
 

Detailed Description

Borrowed type-erased description of a synchronous lightweight task batch.

The callable and its arguments remain owned by the caller. Scheduler implementations may invoke distinct indices concurrently, but this object is valid only until IAsyncScheduler::execute_batch returns.

Member Function Documentation

◆ bind()

template<class Function >
requires std::invocable<Function&, std::size_t>
static auto uni20::async::LightweightTaskBatch::bind ( std::size_t  size,
Function &  function 
) -> LightweightTaskBatch
inlinestatic

Bind a callable for the duration of one synchronous batch call.

Template Parameters
FunctionCallable accepting one std::size_t index.
Parameters
sizeNumber of work items.
functionCallable borrowed by the returned descriptor.

◆ operator()()

void uni20::async::LightweightTaskBatch::operator() ( std::size_t  index) const
inline

Execute one work item.

Parameters
indexWork-item index in [0, size()).

◆ size()

auto uni20::async::LightweightTaskBatch::size ( ) const -> std::size_t
inlinenoexcept

Return the number of independent work items.


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