interface ov::threading::IStreamsExecutor

Overview

Interface for Streams Task Executor. This executor groups worker threads into so-called streams. More…

#include <istreams_executor.hpp>

template IStreamsExecutor: public ov::threading::ITaskExecutor
{
    // enums

    enum ThreadBindingType;

    // structs

    struct Config;

    // methods

    virtual int get_stream_id() = 0;
    virtual int get_numa_node_id() = 0;
    virtual void execute(Task task) = 0;
};

// direct descendants

template IStreamsExecutor;
class CPUStreamsExecutor;

Inherited Members

public:
    // methods

    virtual void run(Task task) = 0;
    virtual void run_and_wait(const std::vector<Task>& tasks);

Detailed Documentation

Interface for Streams Task Executor. This executor groups worker threads into so-called streams.

The executor executes all parallel tasks using threads from one stream. With proper pinning settings it should reduce cache misses for memory bound workloads.

On NUMA hosts GetNumaNodeId() method can be used to define the NUMA node of current stream

Methods

virtual int get_stream_id() = 0

Return the index of current stream.

Returns:

An index of current stream. Or throw exceptions if called not from stream thread

virtual int get_numa_node_id() = 0

Return the id of current NUMA Node.

Returns:

ID of current NUMA Node, or throws exceptions if called not from stream thread

virtual void execute(Task task) = 0

Execute the task in the current thread using streams executor configuration and constraints.

Parameters:

task

A task to start