NVIDIA Holoscan SDK v2.4.0
Holoscan v2.4.0

Class Scheduler

Base Type

Derived Type

class Scheduler : public holoscan::Component

Base class for all schedulers.

This class is the base class for all schedulers including <a class="reference internal" href="classholoscan_1_1MultiThreadScheduler.html#classholoscan_1_1MultiThreadScheduler" target="_self">holoscan::MultiThreadScheduler</a>, <a class="reference internal" href="classholoscan_1_1GreedyScheduler.html#classholoscan_1_1GreedyScheduler" target="_self">holoscan::GreedyScheduler</a> and <a class="reference internal" href="classholoscan_1_1EventBasedScheduler.html#classholoscan_1_1EventBasedScheduler" target="_self">holoscan::EventBasedScheduler</a>. It is used to define the common interface for all schedulers.

Subclassed by holoscan::gxf::GXFScheduler

Public Functions

Scheduler() = default
Scheduler(Scheduler&&) = default
template<typename ArgT, typename ...ArgsT, typename = std::enable_if_t<!std::is_base_of_v<::holoscan::Scheduler, std::decay_t<ArgT>> && (std::is_same_v<::holoscan::Arg, std::decay_t<ArgT>> || std::is_same_v<::holoscan::ArgList, std::decay_t<ArgT>>)>>
inline explicit Scheduler(ArgT &&arg, ArgsT&&... args)

Construct a new Scheduler object.

~Scheduler() override = default
inline Scheduler &id(int64_t id)

Set the Scheduler ID.

Parameters

id – The ID of the scheduler.

Returns

The reference to this scheduler.

inline Scheduler &name(const std::string &name) &

Set the name of the scheduler.

Parameters

name – The name of the scheduler.

Returns

The reference to the scheduler.

inline Scheduler &&name(const std::string &name) &&

Set the name of the scheduler.

Parameters

name – The name of the scheduler.

Returns

The reference to the scheduler.

inline Scheduler &fragment(Fragment *fragment)

Set the fragment of the scheduler.

Parameters

fragment – The pointer to the fragment of the scheduler.

Returns

The reference to the scheduler.

inline Scheduler &spec(const std::shared_ptr<ComponentSpec> &spec)

Set the component specification to the scheduler.

Parameters

spec – The component specification.

Returns

The reference to the scheduler.

inline ComponentSpec *spec()

Get the component specification of the scheduler.

Returns

The pointer to the component specification.

inline std::shared_ptr<ComponentSpec> spec_shared()

Get the shared pointer to the component spec.

Returns

The shared pointer to the component spec.

inline void add_arg(const std::shared_ptr<Resource> &arg)

Add a resource to the scheduler.

Parameters

arg – The resource to add.

inline void add_arg(std::shared_ptr<Resource> &&arg)

Add a resource to the scheduler.

Parameters

arg – The resource to add.

inline std::unordered_map<std::string, std::shared_ptr<Resource>> &resources()

Get the resources of the scheduler.

Returns

The resources of the scheduler.

inline virtual void setup(ComponentSpec &spec)

Define the scheduler specification.

Parameters

spec – The reference to the component specification.

virtual void initialize() override

Initialize the scheduler.

This function is called after the scheduler is created by holoscan::Fragment::make_scheduler().

virtual YAML::Node to_yaml_node() const override

Get a YAML representation of the scheduler.

Returns

YAML node including the base component properties, component spec and resources.

Protected Functions

virtual void reset_graph_entities() override

Reset the GXF GraphEntity of any components associated with the scheduler.

Protected Attributes

std::unordered_map<std::string, std::shared_ptr<Resource>> resources_

The resources used by the scheduler.

Previous Class RuntimeError
Next Class SerializationBuffer
© Copyright 2022-2024, NVIDIA. Last updated on Oct 1, 2024.