Orrery
A GPU-accelerated N-body gravitational simulator
Loading...
Searching...
No Matches
orrery::backend::SerialExecutor Class Referencefinal

Runs the whole range on the calling thread. More...

#include <orrery/backend/serial_executor.hpp>

Inheritance diagram for orrery::backend::SerialExecutor:
orrery::backend::Executor

Public Member Functions

void run (core::Index count, RangeTask task) override
 Call task over pieces that together cover [0, count) exactly once each, and return when all of them have finished.
std::string_view name () const noexcept override
 The scheme's name, for benchmark tables and reports.
unsigned worker_count () const noexcept override
 How many workers this executor divides work between.
CoreClass worker_core_class (unsigned) const noexcept override
 Always unknown.
ExecutorStatistics statistics () const override
 The record of what the workers have done since the last reset.
void reset_statistics () noexcept override
 Set every counter back to zero.

Additional Inherited Members

Protected Member Functions inherited from orrery::backend::Executor
 Executor (const Executor &)=default
 Executor (Executor &&)=default
Executor & operator= (const Executor &)=default
Executor & operator= (Executor &&)=default

Detailed Description

Runs the whole range on the calling thread.

Member Function Documentation

◆ run()

void orrery::backend::SerialExecutor::run ( core::Index count,
RangeTask task )
overridevirtual

Call task over pieces that together cover [0, count) exactly once each, and return when all of them have finished.

The division is the implementation's to choose, and so is the number of threads it uses and the order the pieces run in. A caller may rely on each index being covered exactly once and on all the work being complete on return, and on nothing else.

A count of zero runs nothing. An empty configuration is a configuration, and it reaches the solvers by the same path as any other.

Implements orrery::backend::Executor.

◆ name()

std::string_view orrery::backend::SerialExecutor::name ( ) const
inlinenodiscardoverridevirtualnoexcept

The scheme's name, for benchmark tables and reports.

Implements orrery::backend::Executor.

◆ worker_count()

unsigned orrery::backend::SerialExecutor::worker_count ( ) const
inlinenodiscardoverridevirtualnoexcept

How many workers this executor divides work between.

Implements orrery::backend::Executor.

◆ worker_core_class()

CoreClass orrery::backend::SerialExecutor::worker_core_class ( unsigned ) const
inlinenodiscardoverridevirtualnoexcept

Always unknown.

The calling thread is not pinned, and pinning it would be a side effect on a thread this class does not own.

Implements orrery::backend::Executor.

◆ statistics()

ExecutorStatistics orrery::backend::SerialExecutor::statistics ( ) const
nodiscardoverridevirtual

The record of what the workers have done since the last reset.

Safe to call only when no region is running, which for a single submitting thread means any time run is not on the stack. It copies the per-worker records rather than returning a view of them, because a caller comparing two schemes needs the first scheme's numbers to survive the second scheme running.

Implements orrery::backend::Executor.

◆ reset_statistics()

void orrery::backend::SerialExecutor::reset_statistics ( )
overridevirtualnoexcept

Set every counter back to zero.

A benchmark measures the region it timed rather than the warm-up before it, and once the two have been added together they cannot be separated.

Implements orrery::backend::Executor.


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