NVIDIA Holoscan SDK v0.6
Holoscan v0.6

Class Executor

Derived Type

class Executor

Base class for all executors.

An Executor that manages the execution of a Fragment on a physical node. The framework provides a default Executor that uses a GXF Scheduler to execute an Application.

Subclassed by holoscan::gxf::GXFExecutor

Public Functions

Executor() = delete
inline explicit Executor(Fragment *fragment)

Construct a new Executor object.

Parameters
virtual ~Executor() = default
inline virtual void run(OperatorGraph &graph)

Run the graph.

Parameters
inline virtual std::future<void> run_async(OperatorGraph &graph)

Run the graph asynchronously.

Parameters
Returns
inline virtual void interrupt()
inline void fragment(Fragment *fragment)

Set the pointer to the fragment of the executor.

Parameters
inline Fragment *fragment()

Get a pointer to Fragment object.

Returns
inline virtual void context(void *context)

Set the context.

Parameters
inline void *context()

Get the context.

Returns
inline void context_uint64(uint64_t context)
inline uint64_t context_uint64()
inline virtual std::shared_ptr<ExtensionManager> extension_manager()

Get the extension manager.

Returns

Protected Functions

inline virtual bool initialize_fragment()

Initialize the fragment_ in this Executor.

This method is called by run() to initialize the fragment and the graph of operators in the fragment before execution.

Returns
inline virtual bool initialize_operator(Operator *op)

Initialize the given operator.

This method is called by Operator::initialize() to initialize the operator.

Depending on the type of the operator, this method may be overridden to initialize the operator. For example, the default executor (GXFExecutor) initializes the operator using the GXF API and sets the operator’s ID to the ID of the GXF codelet.

Parameters
Returns
inline virtual bool initialize_scheduler(Scheduler *sch)

Initialize the given scheduler.

This method is called by Scheduler::initialize() to initialize the operator.

Depending on the type of the scheduler, this method may be overridden to initialize the scheduler. For example, the default executor (GXFExecutor) initializes the scheduler using the GXF API and sets the operator’s ID to the ID of the GXF scheduler.

Parameters
Returns
inline virtual bool initialize_network_context(NetworkContext *network_context)

Initialize the given network context.

This method is called by NetworkContext::initialize() to initialize the operator.

Depending on the type of the network context, this method may be overridden to initialize the network context. For example, the default executor (GXFExecutor) initializes the network context using the GXF API and sets the operator’s ID to the ID of the GXF network context.

Parameters
Returns
inline virtual bool add_receivers(const std::shared_ptr<Operator> &op, const std::string &receivers_name, std::vector<std::string> &new_input_labels, std::vector<holoscan::IOSpec*> &iospec_vector)

Add the receivers as input ports of the given operator.

This method is to be called by the Fragment::add_flow() method to support for the case where the destination input port label points to the parameter name of the downstream operator, and the parameter type is ‘std::vector<holoscan::IOSpec*>’. This finds a parameter with with ‘std::vector<holoscan::IOSpec*>’ type and create a new input port with a specific label (‘<parameter name>:<index>’. e.g, ‘receivers:0’).

Parameters
Returns

Protected Attributes

Fragment *fragment_ = nullptr
void *context_ = nullptr
std::shared_ptr<ExtensionManager> extension_manager_

Friends

friend class Fragment
friend class Operator
friend class Scheduler
friend class NetworkContext

© Copyright 2022-2023, NVIDIA. Last updated on Feb 9, 2024.