NVIDIA Holoscan SDK v2.4.0
Holoscan v2.4.0

Class AsynchronousCondition

Base Type

class AsynchronousCondition : public holoscan::gxf::GXFCondition

Condition class to support asynchronous execution of operators.

This condition waits on an asynchronous event which can happen outside of the regular compute function of an operator.

The method <a class="reference internal" href="#classholoscan_1_1AsynchronousCondition_1ae7789669f0c4f3ff885da6668268f5a3" target="_self">event_state()</a> method is used to get or set the asynchronous condition’s state. The possible states are:

  • AsynchronousEventState::READY ///< Initial state, first compute call is pending

  • AsynchronousEventState::WAIT ///< Request to async service yet to be sent, nothing to do but wait

  • AsynchronousEventState::EVENT_WAITING ///< Request sent to an async service, pending event done notification

  • AsynchronousEventState::EVENT_DONE ///< Event done notification received, entity ready to compute

  • AsynchronousEventState::EVENT_NEVER ///< Entity will not call compute again, end of execution

This class wraps GXF SchedulingTerm(nvidia::gxf::AsynchronousSchedulingTerm). The event used corresponds to gxf_event_t enum value GXF_EVENT_EXTERNAL which is supported by all schedulers.

Public Functions

template<typename ArgT, typename ...ArgsT, typename = std::enable_if_t<!std::is_base_of_v<::holoscan::Condition, 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 AsynchronousCondition(ArgT &&arg, ArgsT&&... args)
AsynchronousCondition() = default
AsynchronousCondition(const std::string &name, nvidia::gxf::AsynchronousSchedulingTerm *term)
inline virtual const char *gxf_typename() const override
virtual void setup(ComponentSpec &spec) override

Define the condition specification.

Parameters

spec – The reference to the component specification.

void event_state(AsynchronousEventState state)

Set the condition’s asynchronous event state.

Parameters

state – The state to which the condition should be set.

AsynchronousEventState event_state() const

Get the asynchronous event state.

Returns

The current state of the condition.

nvidia::gxf::AsynchronousSchedulingTerm *get() const

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