NVIDIA Holoscan SDK v2.9.0

holoscan.conditions

此模块为底层 C++ API 条件提供 Python API。

holoscan.conditions.AsynchronousCondition 异步条件类。
holoscan.conditions.BooleanCondition 布尔条件。
holoscan.conditions.CountCondition 计数条件。
holoscan.conditions.CudaBufferAvailableCondition 基于 CudaBuffer 对象中的数据可用性的条件。
holoscan.conditions.CudaEventCondition 条件类,用于通过事件指示 CUDA 流完成时的数据可用性。
holoscan.conditions.CudaStreamCondition 条件类,用于指示 CUDA 流完成时的数据可用性。
holoscan.conditions.DownstreamMessageAffordableCondition 当下游操作器可以接受新消息时允许执行的条件。
holoscan.conditions.ExpiringMessageAvailableCondition 尝试等待接收器中指定数量消息的条件。
holoscan.conditions.MessageAvailableCondition 当上游消息可用时允许执行的条件。
holoscan.conditions.MultiMessageAvailableCondition 检查多个输入中可用消息数量的条件。
holoscan.conditions.MultiMessageAvailableTimeoutCondition 检查多个输入中可用消息数量的条件。
holoscan.conditions.PeriodicCondition 支持操作器定期执行的条件类。

class holoscan.conditions.AsynchronousCondition

基类:holoscan.gxf._gxf.GXFCondition

异步条件类。

用于控制实体是否执行。

属性

args 与组件关联的参数列表。
condition_type 条件类型。
description 描述条件的 YAML 格式字符串。
event_state 事件状态属性
fragment 条件所属的 Fragment。
gxf_cid GXF 组件 ID。
gxf_cname 组件的名称。
gxf_context 组件的 GXF 上下文。
gxf_eid GXF 实体 ID。
gxf_typename 组件的 GXF 类型名称。
id 组件的标识符。
name 条件的名称。

spec

方法

add_arg(*args, **kwargs) 重载函数。
gxf_initialize(self) 初始化组件。
initialize(self) 条件的初始化方法。
receiver(self, port_name) 获取与此条件关联的操作器的输入端口使用的接收器。
setup(self, arg0) 条件的设置方法。
transmitter(self, port_name) 获取与此条件关联的操作器的输出端口使用的发送器。

ConditionComponentType

class ConditionComponentType

基类:pybind11_builtins.pybind11_object

成员

NATIVE

GXF

属性

name

value
GXF = <ConditionComponentType.GXF: 1>
NATIVE = <ConditionComponentType.NATIVE: 0>
__init__(self: holoscan.core._core.Condition.ConditionComponentType, value: int) → None
property name
property value
__init__(self: holoscan.conditions._conditions.AsynchronousCondition, fragment: holoscan.core._core.Fragment, name: str = 'noname_async_condition') → None

异步条件。

参数
fragmentholoscan.core.Fragment

条件将与之关联的 Fragment

namestr, optional

条件的名称。

add_arg(*args, **kwargs)

重载函数。

  1. add_arg(self: holoscan.core._core.ComponentBase, arg: holoscan.core._core.Arg) -> None

向组件添加参数。

  1. add_arg(self: holoscan.core._core.ComponentBase, arg: holoscan.core._core.ArgList) -> None

向组件添加参数列表。

property args

与组件关联的参数列表。

返回
arglistholoscan.core.ArgList
property condition_type

条件类型。

holoscan.core.Condition.ConditionComponentType 枚举,表示条件的类型。当前实现的两种类型为 NATIVE 和 GXF。

property description

描述条件的 YAML 格式字符串。

property event_state

事件状态属性

  • AsynchronousEventState.READY

  • AsynchronousEventState.WAIT

  • AsynchronousEventState.EVENT_WAITING

  • AsynchronousEventState.EVENT_DONE

  • AsynchronousEventState.EVENT_NEVER

property fragment

条件所属的 Fragment。

返回
nameholoscan.core.Fragment
property gxf_cid

GXF 组件 ID。

property gxf_cname

组件的名称。

property gxf_context

组件的 GXF 上下文。

property gxf_eid

GXF 实体 ID。

gxf_initialize(self: holoscan.gxf._gxf.GXFComponent) → None

初始化组件。

property gxf_typename

组件的 GXF 类型名称。

返回
str

组件的 GXF 类型名称。

property id

组件的标识符。

标识符最初设置为 -1,并在组件初始化后变为有效值。

使用默认执行器 (holoscan.gxf.GXFExecutor),标识符设置为 GXF 组件 ID。

返回
idint
initialize(self: holoscan.core._core.Condition) → None

条件的初始化方法。

property name

条件的名称。

返回
namestr
receiver(self: holoscan.core._core.Condition, port_name: str) → Optional[holoscan::Receiver]

获取与此条件关联的操作器的输入端口使用的接收器。

参数
port_namestr

输入端口的名称。

返回
receiverholoscan.resources.Receiver

此输入端口使用的接收器。如果端口不存在,则为 None。

setup(self: holoscan.core._core.Condition, arg0: holoscan.core._core.ComponentSpec) → None

条件的设置方法。

property spec
transmitter(self: holoscan.core._core.Condition, port_name: str) → Optional[holoscan::Transmitter]

获取与此条件关联的操作器的输出端口使用的发送器。

参数
port_namestr

输出端口的名称。

返回
transmitterholoscan.resources.Transmitter 或 None

此输出端口使用的发送器。如果端口不存在,则为 None。

class holoscan.conditions.AsynchronousEventState

基类:pybind11_builtins.pybind11_object

成员

READY

WAIT

EVENT_WAITING

EVENT_DONE

EVENT_NEVER

属性

name

value
EVENT_DONE = <AsynchronousEventState.EVENT_DONE: 3>
EVENT_NEVER = <AsynchronousEventState.EVENT_NEVER: 4>
EVENT_WAITING = <AsynchronousEventState.EVENT_WAITING: 2>
READY = <AsynchronousEventState.READY: 0>
WAIT = <AsynchronousEventState.WAIT: 1>
__init__(self: holoscan.conditions._conditions.AsynchronousEventState, value: int) → None
property name
property value
class holoscan.conditions.BooleanCondition

基类:holoscan.gxf._gxf.GXFCondition

布尔条件。

此条件可以用作操作器的终止开关。一旦条件设置为 false,操作器将进入 NEVER 调度状态,并且无法再次执行。换句话说,此条件当前不能用于暂停和恢复操作器,因为操作器一旦处于 NEVER 状态就无法重启。

参数
fragmentholoscan.core.Fragment

条件将与之关联的 Fragment

enable_tickbool, optional

条件的布尔值。

namestr, optional

条件的名称。

属性

args 与组件关联的参数列表。
condition_type 条件类型。
description 描述条件的 YAML 格式字符串。
fragment 条件所属的 Fragment。
gxf_cid GXF 组件 ID。
gxf_cname 组件的名称。
gxf_context 组件的 GXF 上下文。
gxf_eid GXF 实体 ID。
gxf_typename 组件的 GXF 类型名称。
id 组件的标识符。
name 条件的名称。

spec

方法

add_arg(*args, **kwargs) 重载函数。
check_tick_enabled(self) 检查条件是否为 True
disable_tick(self) 将条件设置为 False
enable_tick(self) 将条件设置为 True
gxf_initialize(self) 初始化组件。
initialize(self) 条件的初始化方法。
receiver(self, port_name) 获取与此条件关联的操作器的输入端口使用的接收器。
setup(self, arg0) 条件的设置方法。
transmitter(self, port_name) 获取与此条件关联的操作器的输出端口使用的发送器。

ConditionComponentType

class ConditionComponentType

基类:pybind11_builtins.pybind11_object

成员

NATIVE

GXF

属性

name

value
GXF = <ConditionComponentType.GXF: 1>
NATIVE = <ConditionComponentType.NATIVE: 0>
__init__(self: holoscan.core._core.Condition.ConditionComponentType, value: int) → None
property name
property value
__init__(self: holoscan.conditions._conditions.BooleanCondition, fragment: holoscan.core._core.Fragment, enable_tick: bool = True, name: str = 'noname_boolean_condition') → None

布尔条件。

此条件可以用作操作器的终止开关。一旦条件设置为 false,操作器将进入 NEVER 调度状态,并且无法再次执行。换句话说,此条件当前不能用于暂停和恢复操作器,因为操作器一旦处于 NEVER 状态就无法重启。

参数
fragmentholoscan.core.Fragment

条件将与之关联的 Fragment

enable_tickbool, optional

条件的布尔值。

namestr, optional

条件的名称。

add_arg(*args, **kwargs)

重载函数。

  1. add_arg(self: holoscan.core._core.ComponentBase, arg: holoscan.core._core.Arg) -> None

向组件添加参数。

  1. add_arg(self: holoscan.core._core.ComponentBase, arg: holoscan.core._core.ArgList) -> None

向组件添加参数列表。

property args

与组件关联的参数列表。

返回
arglistholoscan.core.ArgList
check_tick_enabled(self: holoscan.conditions._conditions.BooleanCondition) → bool

检查条件是否为 True

property condition_type

条件类型。

holoscan.core.Condition.ConditionComponentType 枚举,表示条件的类型。当前实现的两种类型为 NATIVE 和 GXF。

property description

描述条件的 YAML 格式字符串。

disable_tick(self: holoscan.conditions._conditions.BooleanCondition) → None

将条件设置为 False

enable_tick(self: holoscan.conditions._conditions.BooleanCondition) → None

将条件设置为 True

property fragment

条件所属的 Fragment。

返回
nameholoscan.core.Fragment
property gxf_cid

GXF 组件 ID。

property gxf_cname

组件的名称。

property gxf_context

组件的 GXF 上下文。

property gxf_eid

GXF 实体 ID。

gxf_initialize(self: holoscan.gxf._gxf.GXFComponent) → None

初始化组件。

property gxf_typename

组件的 GXF 类型名称。

返回
str

组件的 GXF 类型名称。

property id

组件的标识符。

标识符最初设置为 -1,并在组件初始化后变为有效值。

使用默认执行器 (holoscan.gxf.GXFExecutor),标识符设置为 GXF 组件 ID。

返回
idint
initialize(self: holoscan.core._core.Condition) → None

条件的初始化方法。

property name

条件的名称。

返回
namestr
receiver(self: holoscan.core._core.Condition, port_name: str) → Optional[holoscan::Receiver]

获取与此条件关联的操作器的输入端口使用的接收器。

参数
port_namestr

输入端口的名称。

返回
receiverholoscan.resources.Receiver

此输入端口使用的接收器。如果端口不存在,则为 None。

setup(self: holoscan.core._core.Condition, arg0: holoscan.core._core.ComponentSpec) → None

条件的设置方法。

property spec
transmitter(self: holoscan.core._core.Condition, port_name: str) → Optional[holoscan::Transmitter]

获取与此条件关联的操作器的输出端口使用的发送器。

参数
port_namestr

输出端口的名称。

返回
transmitterholoscan.resources.Transmitter 或 None

此输出端口使用的发送器。如果端口不存在,则为 None。

class holoscan.conditions.CountCondition

基类:holoscan.gxf._gxf.GXFCondition

计数条件。

参数
fragmentholoscan.core.Fragment

条件将与之关联的 Fragment

countint

条件使用的执行计数。

namestr, optional

条件的名称。

属性

args 与组件关联的参数列表。
condition_type 条件类型。
count 与条件关联的执行计数
description 描述条件的 YAML 格式字符串。
fragment 条件所属的 Fragment。
gxf_cid GXF 组件 ID。
gxf_cname 组件的名称。
gxf_context 组件的 GXF 上下文。
gxf_eid GXF 实体 ID。
gxf_typename 组件的 GXF 类型名称。
id 组件的标识符。
name 条件的名称。

spec

方法

add_arg(*args, **kwargs) 重载函数。
gxf_initialize(self) 初始化组件。
initialize(self) 条件的初始化方法。
receiver(self, port_name) 获取与此条件关联的操作器的输入端口使用的接收器。
setup(self, arg0) 条件的设置方法。
transmitter(self, port_name) 获取与此条件关联的操作器的输出端口使用的发送器。

ConditionComponentType

class ConditionComponentType

基类:pybind11_builtins.pybind11_object

成员

NATIVE

GXF

属性

name

value
GXF = <ConditionComponentType.GXF: 1>
NATIVE = <ConditionComponentType.NATIVE: 0>
__init__(self: holoscan.core._core.Condition.ConditionComponentType, value: int) → None
property name
property value
__init__(self: holoscan.conditions._conditions.CountCondition, fragment: holoscan.core._core.Fragment, count: int = 1, name: str = 'noname_count_condition') → None

计数条件。

参数
fragmentholoscan.core.Fragment

条件将与之关联的 Fragment

countint

条件使用的执行计数。

namestr, optional

条件的名称。

add_arg(*args, **kwargs)

重载函数。

  1. add_arg(self: holoscan.core._core.ComponentBase, arg: holoscan.core._core.Arg) -> None

向组件添加参数。

  1. add_arg(self: holoscan.core._core.ComponentBase, arg: holoscan.core._core.ArgList) -> None

向组件添加参数列表。

property args

与组件关联的参数列表。

返回
arglistholoscan.core.ArgList
property condition_type

条件类型。

holoscan.core.Condition.ConditionComponentType 枚举,表示条件的类型。当前实现的两种类型为 NATIVE 和 GXF。

property count

与条件关联的执行计数

property description

描述条件的 YAML 格式字符串。

property fragment

条件所属的 Fragment。

返回
nameholoscan.core.Fragment
property gxf_cid

GXF 组件 ID。

property gxf_cname

组件的名称。

property gxf_context

组件的 GXF 上下文。

property gxf_eid

GXF 实体 ID。

gxf_initialize(self: holoscan.gxf._gxf.GXFComponent) → None

初始化组件。

property gxf_typename

组件的 GXF 类型名称。

返回
str

组件的 GXF 类型名称。

property id

组件的标识符。

标识符最初设置为 -1,并在组件初始化后变为有效值。

使用默认执行器 (holoscan.gxf.GXFExecutor),标识符设置为 GXF 组件 ID。

返回
idint
initialize(self: holoscan.core._core.Condition) → None

条件的初始化方法。

property name

条件的名称。

返回
namestr
receiver(self: holoscan.core._core.Condition, port_name: str) → Optional[holoscan::Receiver]

获取与此条件关联的操作器的输入端口使用的接收器。

参数
port_namestr

输入端口的名称。

返回
receiverholoscan.resources.Receiver

此输入端口使用的接收器。如果端口不存在,则为 None。

setup(self: holoscan.core._core.Condition, arg0: holoscan.core._core.ComponentSpec) → None

条件的设置方法。

property spec
transmitter(self: holoscan.core._core.Condition, port_name: str) → Optional[holoscan::Transmitter]

获取与此条件关联的操作器的输出端口使用的发送器。

参数
port_namestr

输出端口的名称。

返回
transmitterholoscan.resources.Transmitter 或 None

此输出端口使用的发送器。如果端口不存在,则为 None。

class holoscan.conditions.CudaBufferAvailableCondition

基类:holoscan.gxf._gxf.GXFCondition

基于 CudaBuffer 对象中的数据可用性的条件。

一个组件,用于指定基于传入消息中存在的 CudaBuffer 的接收器处的数据可用性。

参数
fragmentholoscan.core.Fragment

条件将与之关联的 Fragment。

receiverstr, optional

操作器的输入端口的名称,条件将应用于该端口。

namestr, optional

条件的名称。

注释

nvidia::gxf::CudaBuffer 类当前未被 Holoscan SDK 使用。此条件专门用于与使用 GXF 的 CudaBuffer 类型的包装 GXF Codelet 进行互操作。

属性

args 与组件关联的参数列表。
condition_type 条件类型。
description 描述条件的 YAML 格式字符串。
fragment 条件所属的 Fragment。
gxf_cid GXF 组件 ID。
gxf_cname 组件的名称。
gxf_context 组件的 GXF 上下文。
gxf_eid GXF 实体 ID。
gxf_typename 组件的 GXF 类型名称。
id 组件的标识符。
name 条件的名称。
receiver 与条件关联的接收器。

spec

方法

add_arg(*args, **kwargs) 重载函数。
gxf_initialize(self) 初始化组件。
initialize(self) 条件的初始化方法。
setup(self, arg0) 条件的设置方法。
transmitter(self, port_name) 获取与此条件关联的操作器的输出端口使用的发送器。

ConditionComponentType

class ConditionComponentType

基类:pybind11_builtins.pybind11_object

成员

NATIVE

GXF

属性

name

value
GXF = <ConditionComponentType.GXF: 1>
NATIVE = <ConditionComponentType.NATIVE: 0>
__init__(self: holoscan.core._core.Condition.ConditionComponentType, value: int) → None
property name
property value
__init__(self: holoscan.conditions._conditions.CudaBufferAvailableCondition, fragment: holoscan.core._core.Fragment, receiver: Optional[str] = None, name: str = 'noname_cuda_buffer_available_condition') → None

基于 CudaBuffer 对象中的数据可用性的条件。

一个组件,用于指定基于传入消息中存在的 CudaBuffer 的接收器处的数据可用性。

参数
fragmentholoscan.core.Fragment

条件将与之关联的 Fragment。

receiverstr, optional

操作器的输入端口的名称,条件将应用于该端口。

namestr, optional

条件的名称。

注释

nvidia::gxf::CudaBuffer 类当前未被 Holoscan SDK 使用。此条件专门用于与使用 GXF 的 CudaBuffer 类型的包装 GXF Codelet 进行互操作。

add_arg(*args, **kwargs)

重载函数。

  1. add_arg(self: holoscan.core._core.ComponentBase, arg: holoscan.core._core.Arg) -> None

向组件添加参数。

  1. add_arg(self: holoscan.core._core.ComponentBase, arg: holoscan.core._core.ArgList) -> None

向组件添加参数列表。

property args

与组件关联的参数列表。

返回
arglistholoscan.core.ArgList
property condition_type

条件类型。

holoscan.core.Condition.ConditionComponentType 枚举,表示条件的类型。当前实现的两种类型为 NATIVE 和 GXF。

property description

描述条件的 YAML 格式字符串。

property fragment

条件所属的 Fragment。

返回
nameholoscan.core.Fragment
property gxf_cid

GXF 组件 ID。

property gxf_cname

组件的名称。

property gxf_context

组件的 GXF 上下文。

property gxf_eid

GXF 实体 ID。

gxf_initialize(self: holoscan.gxf._gxf.GXFComponent) → None

初始化组件。

property gxf_typename

组件的 GXF 类型名称。

返回
str

组件的 GXF 类型名称。

property id

组件的标识符。

标识符最初设置为 -1,并在组件初始化后变为有效值。

使用默认执行器 (holoscan.gxf.GXFExecutor),标识符设置为 GXF 组件 ID。

返回
idint
initialize(self: holoscan.core._core.Condition) → None

条件的初始化方法。

property name

条件的名称。

返回
namestr
property receiver

与条件关联的接收器。

setup(self: holoscan.core._core.Condition, arg0: holoscan.core._core.ComponentSpec) → None

条件的设置方法。

property spec
transmitter(self: holoscan.core._core.Condition, port_name: str) → Optional[holoscan::Transmitter]

获取与此条件关联的操作器的输出端口使用的发送器。

参数
port_namestr

输出端口的名称。

返回
transmitterholoscan.resources.Transmitter 或 None

此输出端口使用的发送器。如果端口不存在,则为 None。

class holoscan.conditions.CudaEventCondition

基类:holoscan.gxf._gxf.GXFCondition

条件类,用于通过事件指示 CUDA 流完成时的数据可用性。

一个条件,用于指定在提供的 cuda 流上完成工作并在 cuda 事件的帮助下,接收器处的数据可用性。此条件将持续轮询提供的事件,以检查数据可用性以供消费。

参数
fragmentholoscan.core.Fragment

条件将与之关联的 Fragment。

event_nameevent, optional

调用 cudaEventQuery API 以获取状态的事件名称。

receiverstr, optional

操作器的输入端口的名称,条件将应用于该端口。

namestr, optional

条件的名称。

注释

当前 Holoscan SDK 未使用 nvidia::gxf::CudaEvent 类。此条件专门用于与使用 GXF 的 CudaEvent 类型的包装 GXF Codelet 进行互操作。

属性

args 与组件关联的参数列表。
condition_type 条件类型。
description 描述条件的 YAML 格式字符串。
fragment 条件所属的 Fragment。
gxf_cid GXF 组件 ID。
gxf_cname 组件的名称。
gxf_context 组件的 GXF 上下文。
gxf_eid GXF 实体 ID。
gxf_typename 组件的 GXF 类型名称。
id 组件的标识符。
name 条件的名称。
receiver 与条件关联的接收器。

spec

方法

add_arg(*args, **kwargs) 重载函数。
gxf_initialize(self) 初始化组件。
initialize(self) 条件的初始化方法。
setup(self, arg0) 条件的设置方法。
transmitter(self, port_name) 获取与此条件关联的操作器的输出端口使用的发送器。

ConditionComponentType

class ConditionComponentType

基类:pybind11_builtins.pybind11_object

成员

NATIVE

GXF

属性

name

value
GXF = <ConditionComponentType.GXF: 1>
NATIVE = <ConditionComponentType.NATIVE: 0>
__init__(self: holoscan.core._core.Condition.ConditionComponentType, value: int) → None
property name
property value
__init__(self: holoscan.conditions._conditions.CudaEventCondition, fragment: holoscan.core._core.Fragment, event_name: str = '', receiver: Optional[str] = None, name: str = 'noname_cuda_event_condition') → None

条件类,用于通过事件指示 CUDA 流完成时的数据可用性。

一个条件,用于指定在提供的 cuda 流上完成工作并在 cuda 事件的帮助下,接收器处的数据可用性。此条件将持续轮询提供的事件,以检查数据可用性以供消费。

参数
fragmentholoscan.core.Fragment

条件将与之关联的 Fragment。

event_nameevent, optional

调用 cudaEventQuery API 以获取状态的事件名称。

receiverstr, optional

操作器的输入端口的名称,条件将应用于该端口。

namestr, optional

条件的名称。

注释

当前 Holoscan SDK 未使用 nvidia::gxf::CudaEvent 类。此条件专门用于与使用 GXF 的 CudaEvent 类型的包装 GXF Codelet 进行互操作。

add_arg(*args, **kwargs)

重载函数。

  1. add_arg(self: holoscan.core._core.ComponentBase, arg: holoscan.core._core.Arg) -> None

向组件添加参数。

  1. add_arg(self: holoscan.core._core.ComponentBase, arg: holoscan.core._core.ArgList) -> None

向组件添加参数列表。

property args

与组件关联的参数列表。

返回
arglistholoscan.core.ArgList
property condition_type

条件类型。

holoscan.core.Condition.ConditionComponentType 枚举,表示条件的类型。当前实现的两种类型为 NATIVE 和 GXF。

property description

描述条件的 YAML 格式字符串。

property fragment

条件所属的 Fragment。

返回
nameholoscan.core.Fragment
property gxf_cid

GXF 组件 ID。

property gxf_cname

组件的名称。

property gxf_context

组件的 GXF 上下文。

property gxf_eid

GXF 实体 ID。

gxf_initialize(self: holoscan.gxf._gxf.GXFComponent) → None

初始化组件。

property gxf_typename

组件的 GXF 类型名称。

返回
str

组件的 GXF 类型名称。

property id

组件的标识符。

标识符最初设置为 -1,并在组件初始化后变为有效值。

使用默认执行器 (holoscan.gxf.GXFExecutor),标识符设置为 GXF 组件 ID。

返回
idint
initialize(self: holoscan.core._core.Condition) → None

条件的初始化方法。

property name

条件的名称。

返回
namestr
property receiver

与条件关联的接收器。

setup(self: holoscan.core._core.Condition, arg0: holoscan.core._core.ComponentSpec) → None

条件的设置方法。

property spec
transmitter(self: holoscan.core._core.Condition, port_name: str) → Optional[holoscan::Transmitter]

获取与此条件关联的操作器的输出端口使用的发送器。

参数
port_namestr

输出端口的名称。

返回
transmitterholoscan.resources.Transmitter 或 None

此输出端口使用的发送器。如果端口不存在,则为 None。

class holoscan.conditions.CudaStreamCondition

基类:holoscan.gxf._gxf.GXFCondition

条件类,用于指示 CUDA 流完成时的数据可用性。

此条件将注册一个回调函数,该函数将在指定的 CUDA 流上完成工作后调用,指示数据可供消费。

参数
fragmentholoscan.core.Fragment

条件将与之关联的 Fragment。

receiverstr, optional

操作器的输入端口的名称,条件将应用于该端口。

namestr, optional

条件的名称。

属性

args 与组件关联的参数列表。
condition_type 条件类型。
description 描述条件的 YAML 格式字符串。
fragment 条件所属的 Fragment。
gxf_cid GXF 组件 ID。
gxf_cname 组件的名称。
gxf_context 组件的 GXF 上下文。
gxf_eid GXF 实体 ID。
gxf_typename 组件的 GXF 类型名称。
id 组件的标识符。
name 条件的名称。
receiver 与条件关联的接收器。

spec

方法

add_arg(*args, **kwargs) 重载函数。
gxf_initialize(self) 初始化组件。
initialize(self) 条件的初始化方法。
setup(self, arg0) 条件的设置方法。
transmitter(self, port_name) 获取与此条件关联的操作器的输出端口使用的发送器。

ConditionComponentType

class ConditionComponentType

基类:pybind11_builtins.pybind11_object

成员

NATIVE

GXF

属性

name

value
GXF = <ConditionComponentType.GXF: 1>
NATIVE = <ConditionComponentType.NATIVE: 0>
__init__(self: holoscan.core._core.Condition.ConditionComponentType, value: int) → None
property name
property value
__init__(self: holoscan.conditions._conditions.CudaStreamCondition, fragment: holoscan.core._core.Fragment, receiver: Optional[str] = None, name: str = 'noname_cuda_stream_condition') → None

条件类,用于指示 CUDA 流完成时的数据可用性。

此条件将注册一个回调函数,该函数将在指定的 CUDA 流上完成工作后调用,指示数据可供消费。

参数
fragmentholoscan.core.Fragment

条件将与之关联的 Fragment。

receiverstr, optional

操作器的输入端口的名称,条件将应用于该端口。

namestr, optional

条件的名称。

add_arg(*args, **kwargs)

重载函数。

  1. add_arg(self: holoscan.core._core.ComponentBase, arg: holoscan.core._core.Arg) -> None

向组件添加参数。

  1. add_arg(self: holoscan.core._core.ComponentBase, arg: holoscan.core._core.ArgList) -> None

向组件添加参数列表。

property args

与组件关联的参数列表。

返回
arglistholoscan.core.ArgList
property condition_type

条件类型。

holoscan.core.Condition.ConditionComponentType 枚举,表示条件的类型。当前实现的两种类型为 NATIVE 和 GXF。

property description

描述条件的 YAML 格式字符串。

property fragment

条件所属的 Fragment。

返回
nameholoscan.core.Fragment
property gxf_cid

GXF 组件 ID。

property gxf_cname

组件的名称。

property gxf_context

组件的 GXF 上下文。

property gxf_eid

GXF 实体 ID。

gxf_initialize(self: holoscan.gxf._gxf.GXFComponent) → None

初始化组件。

property gxf_typename

组件的 GXF 类型名称。

返回
str

组件的 GXF 类型名称。

property id

组件的标识符。

标识符最初设置为 -1,并在组件初始化后变为有效值。

使用默认执行器 (holoscan.gxf.GXFExecutor),标识符设置为 GXF 组件 ID。

返回
idint
initialize(self: holoscan.core._core.Condition) → None

条件的初始化方法。

property name

条件的名称。

返回
namestr
property receiver

与条件关联的接收器。

setup(self: holoscan.core._core.Condition, arg0: holoscan.core._core.ComponentSpec) → None

条件的设置方法。

property spec
transmitter(self: holoscan.core._core.Condition, port_name: str) → Optional[holoscan::Transmitter]

获取与此条件关联的操作器的输出端口使用的发送器。

参数
port_namestr

输出端口的名称。

返回
transmitterholoscan.resources.Transmitter 或 None

此输出端口使用的发送器。如果端口不存在,则为 None。

class holoscan.conditions.DownstreamMessageAffordableCondition

基类:holoscan.gxf._gxf.GXFCondition

当下游操作器可以接受新消息时允许执行的条件。

当下游连接的操作器的接收器队列至少有一定数量的空闲元素时满足。允许实体执行的最小消息数由 min_size 指定。它可以用于防止操作器在下游操作器未准备好接收消息时发送消息。

参数
fragmentholoscan.core.Fragment

条件将与之关联的 Fragment

min_sizeint

后备缓冲区中存在的最小空闲槽数。

transmitterstr, optional

操作器的输出端口的名称,条件将应用于该端口。

namestr, optional

条件的名称。

注释

此条件通常在 Operator.setup 方法中使用 IOSpec.condition 方法和 ConditionType.DOWNSTREAM_MESSAGE_AFFORDABLE 设置。在这种情况下,发送器名称已从与 IOSpec 对象对应的端口中得知,因此不需要 “transmitter” 参数。

属性

args 与组件关联的参数列表。
condition_type 条件类型。
description 描述条件的 YAML 格式字符串。
fragment 条件所属的 Fragment。
gxf_cid GXF 组件 ID。
gxf_cname 组件的名称。
gxf_context 组件的 GXF 上下文。
gxf_eid GXF 实体 ID。
gxf_typename 组件的 GXF 类型名称。
id 组件的标识符。
min_size 下游实体的后备缓冲区所需的最小空闲槽数。
name 条件的名称。
transmitter 与条件关联的发送器。

spec

方法

add_arg(*args, **kwargs) 重载函数。
gxf_initialize(self) 初始化组件。
initialize(self) 条件的初始化方法。
receiver(self, port_name) 获取与此条件关联的操作器的输入端口使用的接收器。
setup(self, arg0) 条件的设置方法。

ConditionComponentType

class ConditionComponentType

基类:pybind11_builtins.pybind11_object

成员

NATIVE

GXF

属性

name

value
GXF = <ConditionComponentType.GXF: 1>
NATIVE = <ConditionComponentType.NATIVE: 0>
__init__(self: holoscan.core._core.Condition.ConditionComponentType, value: int) → None
property name
property value
__init__(self: holoscan.conditions._conditions.DownstreamMessageAffordableCondition, fragment: holoscan.core._core.Fragment, min_size: int = 1, transmitter: Optional[str] = None, name: str = 'noname_downstream_affordable_condition') → None

当下游操作器可以接受新消息时允许执行的条件。

当下游连接的操作器的接收器队列至少有一定数量的空闲元素时满足。允许实体执行的最小消息数由 min_size 指定。它可以用于防止操作器在下游操作器未准备好接收消息时发送消息。

参数
fragmentholoscan.core.Fragment

条件将与之关联的 Fragment

min_sizeint

后备缓冲区中存在的最小空闲槽数。

transmitterstr, optional

操作器的输出端口的名称,条件将应用于该端口。

namestr, optional

条件的名称。

注释

此条件通常在 Operator.setup 方法中使用 IOSpec.condition 方法和 ConditionType.DOWNSTREAM_MESSAGE_AFFORDABLE 设置。在这种情况下,发送器名称已从与 IOSpec 对象对应的端口中得知,因此不需要 “transmitter” 参数。

add_arg(*args, **kwargs)

重载函数。

  1. add_arg(self: holoscan.core._core.ComponentBase, arg: holoscan.core._core.Arg) -> None

向组件添加参数。

  1. add_arg(self: holoscan.core._core.ComponentBase, arg: holoscan.core._core.ArgList) -> None

向组件添加参数列表。

property args

与组件关联的参数列表。

返回
arglistholoscan.core.ArgList
property condition_type

条件类型。

holoscan.core.Condition.ConditionComponentType 枚举,表示条件的类型。当前实现的两种类型为 NATIVE 和 GXF。

property description

描述条件的 YAML 格式字符串。

property fragment

条件所属的 Fragment。

返回
nameholoscan.core.Fragment
property gxf_cid

GXF 组件 ID。

property gxf_cname

组件的名称。

property gxf_context

组件的 GXF 上下文。

property gxf_eid

GXF 实体 ID。

gxf_initialize(self: holoscan.gxf._gxf.GXFComponent) → None

初始化组件。

property gxf_typename

组件的 GXF 类型名称。

返回
str

组件的 GXF 类型名称。

property id

组件的标识符。

标识符最初设置为 -1,并在组件初始化后变为有效值。

使用默认执行器 (holoscan.gxf.GXFExecutor),标识符设置为 GXF 组件 ID。

返回
idint
initialize(self: holoscan.core._core.Condition) → None

条件的初始化方法。

property min_size

下游实体的后备缓冲区所需的最小空闲槽数。

property name

条件的名称。

返回
namestr
receiver(self: holoscan.core._core.Condition, port_name: str) → Optional[holoscan::Receiver]

获取与此条件关联的操作器的输入端口使用的接收器。

参数
port_namestr

输入端口的名称。

返回
receiverholoscan.resources.Receiver

此输入端口使用的接收器。如果端口不存在,则为 None。

setup(self: holoscan.core._core.Condition, arg0: holoscan.core._core.ComponentSpec) → None

条件的设置方法。

property spec
property transmitter

与条件关联的发送器。

class holoscan.conditions.ExpiringMessageAvailableCondition

基类:holoscan.gxf._gxf.GXFCondition

尝试等待接收器中指定数量消息的条件。当队列中的第一条消息在自到达起指定的延迟后成熟时,无论如何都会触发。

参数
fragmentholoscan.core.Fragment

条件将与之关联的 Fragment

max_batch_sizeint

要批量处理的最大消息数。

max_delay_ns: int 或 datetime.timedelta

从第一条消息的时间开始算起,在无论如何提交工作负载之前要等待的最大延迟。如果提供 int,则值必须以纳秒为单位。任何提供的 datetime.timedelta 值都将在内部转换为相应的等待纳秒数。

clockholoscan.resources.Clock 或 None, optional

调度器用于定义时间流逝的时钟。如果为 None,将使用默认构造的 holoscan.resources.RealtimeClock

receiverstr, optional

操作器的输入端口的名称,条件将应用于该端口。

namestr, optional

条件的名称。

注释

此条件通常在 Operator.setup 方法中使用 IOSpec.condition 方法和 ConditionType.EXPIRING_MESSAGE_AVAILABLE 设置。在这种情况下,接收器名称已从与 IOSpec 对象对应的端口中得知,因此不需要 “receiver” 参数。

此条件类型使用的 max_delay_ns 相对于接收器队列中最旧消息的时间戳。使用此条件需要上游操作器为队列中的至少一条消息发出时间戳。Holoscan 操作器默认不发出时间戳,而仅当在 Operator::emit 调用中显式请求时才发出。SDK 的内置操作器当前不发出时间戳,因此此条件不容易与提供的操作器一起使用。作为潜在的替代方案,请参阅 MultiMessageAvailableTimeoutCondition,它可以配置为使用单个端口和超时时间间隔,而无需时间戳。MultiMessageAvailableTimeoutCondition 的情况下不需要时间戳,因为测量的间隔是自同一操作器上次滴答以来的时间。

属性

args 与组件关联的参数列表。
condition_type 条件类型。
description 描述条件的 YAML 格式字符串。
fragment 条件所属的 Fragment。
gxf_cid GXF 组件 ID。
gxf_cname 组件的名称。
gxf_context 组件的 GXF 上下文。
gxf_eid GXF 实体 ID。
gxf_typename 组件的 GXF 类型名称。
id 组件的标识符。
max_batch_size 要批量处理的最大消息数。
name 条件的名称。
receiver 与条件关联的接收器。

spec

方法

add_arg(*args, **kwargs) 重载函数。
gxf_initialize(self) 初始化组件。
initialize(self) 条件的初始化方法。
max_delay(*args, **kwargs) 重载函数。
max_delay_ns(self) 从第一条消息开始等待的最大延迟,然后再提交工作负载。
setup(self, arg0) 条件的设置方法。
transmitter(self, port_name) 获取与此条件关联的操作器的输出端口使用的发送器。

ConditionComponentType

class ConditionComponentType

基类:pybind11_builtins.pybind11_object

成员

NATIVE

GXF

属性

name

value
GXF = <ConditionComponentType.GXF: 1>
NATIVE = <ConditionComponentType.NATIVE: 0>
__init__(self: holoscan.core._core.Condition.ConditionComponentType, value: int) → None
property name
property value
__init__(*args, **kwargs)

重载函数。

  1. __init__(self: holoscan.conditions._conditions.ExpiringMessageAvailableCondition, fragment: holoscan.core._core.Fragment, max_batch_size: int, max_delay_ns: int, clock: holoscan.resources._resources.Clock = None, receiver: Optional[str] = None, name: str = ‘noname_expiring_message_available_condition’) -> None

  2. __init__(self: holoscan.conditions._conditions.ExpiringMessageAvailableCondition, fragment: holoscan.core._core.Fragment, max_batch_size: int, max_delay_ns: datetime.timedelta, clock: holoscan.resources._resources.Clock = None, receiver: Optional[str] = None, name: str = ‘noname_expiring_message_available_condition’) -> None

尝试等待接收器中指定数量消息的条件。当队列中的第一条消息在自到达起指定的延迟后成熟时,无论如何都会触发。

参数
fragmentholoscan.core.Fragment

条件将与之关联的 Fragment

max_batch_sizeint

要批量处理的最大消息数。

max_delay_ns: int 或 datetime.timedelta

从第一条消息的时间开始算起,在无论如何提交工作负载之前要等待的最大延迟。如果提供 int,则值必须以纳秒为单位。任何提供的 datetime.timedelta 值都将在内部转换为相应的等待纳秒数。

clockholoscan.resources.Clock 或 None, optional

调度器用于定义时间流逝的时钟。如果为 None,将使用默认构造的 holoscan.resources.RealtimeClock

receiverstr, optional

操作器的输入端口的名称,条件将应用于该端口。

namestr, optional

条件的名称。

注释

此条件通常在 Operator.setup 方法中使用 IOSpec.condition 方法和 ConditionType.EXPIRING_MESSAGE_AVAILABLE 设置。在这种情况下,接收器名称已从与 IOSpec 对象对应的端口中得知,因此不需要 “receiver” 参数。

此条件类型使用的 max_delay_ns 相对于接收器队列中最旧消息的时间戳。使用此条件需要上游操作器为队列中的至少一条消息发出时间戳。Holoscan 操作器默认不发出时间戳,而仅当在 Operator::emit 调用中显式请求时才发出。SDK 的内置操作器当前不发出时间戳,因此此条件不容易与提供的操作器一起使用。作为潜在的替代方案,请参阅 MultiMessageAvailableTimeoutCondition,它可以配置为使用单个端口和超时时间间隔,而无需时间戳。MultiMessageAvailableTimeoutCondition 的情况下不需要时间戳,因为测量的间隔是自同一操作器上次滴答以来的时间。

add_arg(*args, **kwargs)

重载函数。

  1. add_arg(self: holoscan.core._core.ComponentBase, arg: holoscan.core._core.Arg) -> None

向组件添加参数。

  1. add_arg(self: holoscan.core._core.ComponentBase, arg: holoscan.core._core.ArgList) -> None

向组件添加参数列表。

property args

与组件关联的参数列表。

返回
arglistholoscan.core.ArgList
property condition_type

条件类型。

holoscan.core.Condition.ConditionComponentType 枚举,表示条件的类型。当前实现的两种类型为 NATIVE 和 GXF。

property description

描述条件的 YAML 格式字符串。

property fragment

条件所属的 Fragment。

返回
nameholoscan.core.Fragment
property gxf_cid

GXF 组件 ID。

property gxf_cname

组件的名称。

property gxf_context

组件的 GXF 上下文。

property gxf_eid

GXF 实体 ID。

gxf_initialize(self: holoscan.gxf._gxf.GXFComponent) → None

初始化组件。

property gxf_typename

组件的 GXF 类型名称。

返回
str

组件的 GXF 类型名称。

property id

组件的标识符。

标识符最初设置为 -1,并在组件初始化后变为有效值。

使用默认执行器 (holoscan.gxf.GXFExecutor),标识符设置为 GXF 组件 ID。

返回
idint
initialize(self: holoscan.core._core.Condition) → None

条件的初始化方法。

property max_batch_size

要批量处理的最大消息数。

max_delay(*args, **kwargs)

重载函数。

  1. max_delay(self: holoscan.conditions._conditions.ExpiringMessageAvailableCondition, arg0: int) -> None

从第一条消息开始等待的最大延迟,然后再提交工作负载。

  1. max_delay(self: holoscan.conditions._conditions.ExpiringMessageAvailableCondition, arg0: datetime.timedelta) -> None

从第一条消息开始等待的最大延迟,然后再提交工作负载。

max_delay_ns(self: holoscan.conditions._conditions.ExpiringMessageAvailableCondition) → int

从第一条消息开始等待的最大延迟,然后再提交工作负载。

property name

条件的名称。

返回
namestr
property receiver

与条件关联的接收器。

setup(self: holoscan.core._core.Condition, arg0: holoscan.core._core.ComponentSpec) → None

条件的设置方法。

property spec
transmitter(self: holoscan.core._core.Condition, port_name: str) → Optional[holoscan::Transmitter]

获取与此条件关联的操作器的输出端口使用的发送器。

参数
port_namestr

输出端口的名称。

返回
transmitterholoscan.resources.Transmitter 或 None

此输出端口使用的发送器。如果端口不存在,则为 None。

class holoscan.conditions.MessageAvailableCondition

基类:holoscan.gxf._gxf.GXFCondition

当上游消息可用时允许执行的条件。

当关联的接收器队列至少具有一定数量的元素时满足。接收器使用调度项的 receiver 参数指定。允许实体执行的最小消息数由 min_size 指定。此调度项的可选参数是 front_stage_max_size,即最大前台消息计数。如果设置了此参数,则仅当队列中的消息数不超过此计数时,调度项才允许执行。它可用于不消耗队列中所有消息的操作器。

参数
fragmentholoscan.core.Fragment

条件将与之关联的 Fragment

min_sizeint

允许执行所需的输入通道集上的消息总数。

front_stage_max_sizeint

前台消息数量的阈值。仅当队列中的前台消息数不超过此计数时,才允许执行。

receiverstr, optional

操作器的输入端口的名称,条件将应用于该端口。

namestr, optional

条件的名称。

注释

此条件通常在 Operator.setup 方法中使用 IOSpec.condition 方法和 ConditionType.MESSAGE_AVAILABLE 设置。在这种情况下,接收器名称已从与 IOSpec 对象对应的端口中得知,因此不需要 “receiver” 参数。

属性

args 与组件关联的参数列表。
condition_type 条件类型。
description 描述条件的 YAML 格式字符串。
fragment 条件所属的 Fragment。
front_stage_max_size 前台消息数量的阈值。
gxf_cid GXF 组件 ID。
gxf_cname 组件的名称。
gxf_context 组件的 GXF 上下文。
gxf_eid GXF 实体 ID。
gxf_typename 组件的 GXF 类型名称。
id 组件的标识符。
min_size 允许执行所需的输入通道集上的消息总数。
name 条件的名称。
receiver 与条件关联的接收器。

spec

方法

add_arg(*args, **kwargs) 重载函数。
gxf_initialize(self) 初始化组件。
initialize(self) 条件的初始化方法。
setup(self, arg0) 条件的设置方法。
transmitter(self, port_name) 获取与此条件关联的操作器的输出端口使用的发送器。

ConditionComponentType

class ConditionComponentType

基类:pybind11_builtins.pybind11_object

成员

NATIVE

GXF

属性

name

value
GXF = <ConditionComponentType.GXF: 1>
NATIVE = <ConditionComponentType.NATIVE: 0>
__init__(self: holoscan.core._core.Condition.ConditionComponentType, value: int) → None
property name
property value
__init__(self: holoscan.conditions._conditions.MessageAvailableCondition, fragment: holoscan.core._core.Fragment, min_size: int = 1, front_stage_max_size: int = 1, receiver: Optional[str] = None, name: str = 'noname_message_available_condition') → None

当上游消息可用时允许执行的条件。

当关联的接收器队列至少具有一定数量的元素时满足。接收器使用调度项的 receiver 参数指定。允许实体执行的最小消息数由 min_size 指定。此调度项的可选参数是 front_stage_max_size,即最大前台消息计数。如果设置了此参数,则仅当队列中的消息数不超过此计数时,调度项才允许执行。它可用于不消耗队列中所有消息的操作器。

参数
fragmentholoscan.core.Fragment

条件将与之关联的 Fragment

min_sizeint

允许执行所需的输入通道集上的消息总数。

front_stage_max_sizeint

前台消息数量的阈值。仅当队列中的前台消息数不超过此计数时,才允许执行。

receiverstr, optional

操作器的输入端口的名称,条件将应用于该端口。

namestr, optional

条件的名称。

注释

此条件通常在 Operator.setup 方法中使用 IOSpec.condition 方法和 ConditionType.MESSAGE_AVAILABLE 设置。在这种情况下,接收器名称已从与 IOSpec 对象对应的端口中得知,因此不需要 “receiver” 参数。

add_arg(*args, **kwargs)

重载函数。

  1. add_arg(self: holoscan.core._core.ComponentBase, arg: holoscan.core._core.Arg) -> None

向组件添加参数。

  1. add_arg(self: holoscan.core._core.ComponentBase, arg: holoscan.core._core.ArgList) -> None

向组件添加参数列表。

property args

与组件关联的参数列表。

返回
arglistholoscan.core.ArgList
property condition_type

条件类型。

holoscan.core.Condition.ConditionComponentType 枚举,表示条件的类型。当前实现的两种类型为 NATIVE 和 GXF。

property description

描述条件的 YAML 格式字符串。

property fragment

条件所属的 Fragment。

返回
nameholoscan.core.Fragment
property front_stage_max_size

前台消息数量的阈值。仅当队列中的前台消息数不超过此计数时,才允许执行。

property gxf_cid

GXF 组件 ID。

property gxf_cname

组件的名称。

property gxf_context

组件的 GXF 上下文。

property gxf_eid

GXF 实体 ID。

gxf_initialize(self: holoscan.gxf._gxf.GXFComponent) → None

初始化组件。

property gxf_typename

组件的 GXF 类型名称。

返回
str

组件的 GXF 类型名称。

property id

组件的标识符。

标识符最初设置为 -1,并在组件初始化后变为有效值。

使用默认执行器 (holoscan.gxf.GXFExecutor),标识符设置为 GXF 组件 ID。

返回
idint
initialize(self: holoscan.core._core.Condition) → None

条件的初始化方法。

property min_size

允许执行所需的输入通道集上的消息总数。

property name

条件的名称。

返回
namestr
property receiver

与条件关联的接收器。

setup(self: holoscan.core._core.Condition, arg0: holoscan.core._core.ComponentSpec) → None

条件的设置方法。

property spec
transmitter(self: holoscan.core._core.Condition, port_name: str) → Optional[holoscan::Transmitter]

获取与此条件关联的操作器的输出端口使用的发送器。

参数
port_namestr

输出端口的名称。

返回
transmitterholoscan.resources.Transmitter 或 None

此输出端口使用的发送器。如果端口不存在,则为 None。

class holoscan.conditions.MultiMessageAvailableCondition

基类:holoscan.gxf._gxf.GXFCondition

检查多个输入中可用消息数量的条件。

此条件用于检查多个输入端口是否有足够数量的消息可用。它可以以两种模式之一运行。

  1. SUM_OF_ALL: 此条件检查所有输入端口可用的消息总和

是否大于或等于给定的阈值。 对于此模式,应指定 min_sum

  1. PER_RECEIVER: 此条件检查每个输入端口可用的消息数量

是否大于或等于给定的阈值。 对于此模式,应指定 min_sizes

参数
fragmentholoscan.core.Fragment

条件将与之关联的 Fragment

sampling_mode{“SumOfAll”, “PerReceiver”} 或 MultiMessageAvailableCondition.SamplingMode,可选

在检查接收器队列中的消息时使用的采样方法。

min_sumint,可选

如果所有接收器的消息计数总和至少具有给定数量的可用消息,则此条件允许执行。 此选项仅适用于 “SumOfAll” sampling_mode

min_sizeslist of int,可选

如果所有给定的接收器在此列表中至少具有给定数量的可用消息,则此条件允许执行。 此选项仅适用于 “PerReceiver” sampling_modemin_sizes 的长度必须与与条件关联的接收器数量匹配。

namestr, optional

条件的名称。

注释

此条件通常通过 Operator.multi_port_condition 方法使用 ConditionType.MULTI_MESSAGE_AVAILABLE 设置。 “receivers” 参数必须根据 “Parameters” 部分中描述的输入端口名称进行设置。

属性

args 与组件关联的参数列表。
condition_type 条件类型。
description 描述条件的 YAML 格式字符串。
fragment 条件所属的 Fragment。
gxf_cid GXF 组件 ID。
gxf_cname 组件的名称。
gxf_context 组件的 GXF 上下文。
gxf_eid GXF 实体 ID。
gxf_typename 组件的 GXF 类型名称。
id 组件的标识符。
min_sizes 获取允许实体执行的最小消息数。
min_sum 允许实体执行的消息总数。
name 条件的名称。
receivers 与条件关联的接收器。
sampling_mode 条件的采样模式。

spec

方法

add_arg(*args, **kwargs) 重载函数。
add_min_size(self, value) 将整数值附加到 min_sizes 向量。
gxf_initialize(self) 初始化组件。
initialize(self) 条件的初始化方法。
receiver(self, port_name) 获取与此条件关联的操作器的输入端口使用的接收器。
setup(self, arg0) 条件的设置方法。
transmitter(self, port_name) 获取与此条件关联的操作器的输出端口使用的发送器。

ConditionComponentType
SamplingMode

class ConditionComponentType

基类:pybind11_builtins.pybind11_object

成员

NATIVE

GXF

属性

name

value
GXF = <ConditionComponentType.GXF: 1>
NATIVE = <ConditionComponentType.NATIVE: 0>
__init__(self: holoscan.core._core.Condition.ConditionComponentType, value: int) → None
property name
property value
class SamplingMode

基类:pybind11_builtins.pybind11_object

成员

SUM_OF_ALL

PER_RECEIVER

属性

name

value
PER_RECEIVER = <SamplingMode.PER_RECEIVER: 1>
SUM_OF_ALL = <SamplingMode.SUM_OF_ALL: 0>
__init__(self: holoscan.conditions._conditions.MultiMessageAvailableCondition.SamplingMode, value: int) → None
property name
property value
__init__(self: holoscan.conditions._conditions.MultiMessageAvailableCondition, fragment: holoscan.core._core.Fragment, sampling_mode: Union[holoscan.conditions._conditions.MultiMessageAvailableCondition.SamplingMode, str] = <SamplingMode.SUM_OF_ALL: 0>, min_sum: Optional[int] = None, min_sizes: Optional[list[int]] = None, name: str = 'multi_message_condition') → None

检查多个输入中可用消息数量的条件。

此条件用于检查多个输入端口是否有足够数量的消息可用。它可以以两种模式之一运行。

  1. SUM_OF_ALL: 此条件检查所有输入端口可用的消息总和

是否大于或等于给定的阈值。 对于此模式,应指定 min_sum

  1. PER_RECEIVER: 此条件检查每个输入端口可用的消息数量

是否大于或等于给定的阈值。 对于此模式,应指定 min_sizes

参数
fragmentholoscan.core.Fragment

条件将与之关联的 Fragment

sampling_mode{“SumOfAll”, “PerReceiver”} 或 MultiMessageAvailableCondition.SamplingMode,可选

在检查接收器队列中的消息时使用的采样方法。

min_sumint,可选

如果所有接收器的消息计数总和至少具有给定数量的可用消息,则此条件允许执行。 此选项仅适用于 “SumOfAll” sampling_mode

min_sizeslist of int,可选

如果所有给定的接收器在此列表中至少具有给定数量的可用消息,则此条件允许执行。 此选项仅适用于 “PerReceiver” sampling_modemin_sizes 的长度必须与与条件关联的接收器数量匹配。

namestr, optional

条件的名称。

注释

此条件通常通过 Operator.multi_port_condition 方法使用 ConditionType.MULTI_MESSAGE_AVAILABLE 设置。 “receivers” 参数必须根据 “Parameters” 部分中描述的输入端口名称进行设置。

add_arg(*args, **kwargs)

重载函数。

  1. add_arg(self: holoscan.core._core.ComponentBase, arg: holoscan.core._core.Arg) -> None

向组件添加参数。

  1. add_arg(self: holoscan.core._core.ComponentBase, arg: holoscan.core._core.ArgList) -> None

向组件添加参数列表。

add_min_size(self: holoscan.conditions._conditions.MultiMessageAvailableCondition, value: int) → None

将整数值附加到 min_sizes 向量。

参数
valueint

要附加到 min_sizes 向量的值。

property args

与组件关联的参数列表。

返回
arglistholoscan.core.ArgList
property condition_type

条件类型。

holoscan.core.Condition.ConditionComponentType 枚举,表示条件的类型。当前实现的两种类型为 NATIVE 和 GXF。

property description

描述条件的 YAML 格式字符串。

property fragment

条件所属的 Fragment。

返回
nameholoscan.core.Fragment
property gxf_cid

GXF 组件 ID。

property gxf_cname

组件的名称。

property gxf_context

组件的 GXF 上下文。

property gxf_eid

GXF 实体 ID。

gxf_initialize(self: holoscan.gxf._gxf.GXFComponent) → None

初始化组件。

property gxf_typename

组件的 GXF 类型名称。

返回
str

组件的 GXF 类型名称。

property id

组件的标识符。

标识符最初设置为 -1,并在组件初始化后变为有效值。

使用默认执行器 (holoscan.gxf.GXFExecutor),标识符设置为 GXF 组件 ID。

返回
idint
initialize(self: holoscan.core._core.Condition) → None

条件的初始化方法。

property min_sizes

获取允许实体执行的最小消息数。 每个与此条件关联的接收器都有一个值。 仅当 sampling_mode 设置为 MultiMessageAvailableCondition.SamplingMode.PER_RECEIVER 时才使用此参数;否则,将忽略它。

property min_sum

允许实体执行的消息总数。 此总数是所有与此条件关联的接收器的总和。 仅当 sampling_mode 设置为 MultiMessageAvailableCondition.SamplingMode.SUM_OF_ALL 时才使用此参数;否则,将忽略它。

property name

条件的名称。

返回
namestr
receiver(self: holoscan.core._core.Condition, port_name: str) → Optional[holoscan::Receiver]

获取与此条件关联的操作器的输入端口使用的接收器。

参数
port_namestr

输入端口的名称。

返回
receiverholoscan.resources.Receiver

此输入端口使用的接收器。如果端口不存在,则为 None。

property receivers

与条件关联的接收器。

property sampling_mode

条件的采样模式。 此参数确定如何计算最小消息数。 两个可能的值为:MultiMessageAvailableCondition.SamplingMode.SUM_OF_ALLMultiMessageAvailableCondition.SamplingMode.PER_RECEIVER.

setup(self: holoscan.core._core.Condition, arg0: holoscan.core._core.ComponentSpec) → None

条件的设置方法。

property spec
transmitter(self: holoscan.core._core.Condition, port_name: str) → Optional[holoscan::Transmitter]

获取与此条件关联的操作器的输出端口使用的发送器。

参数
port_namestr

输出端口的名称。

返回
transmitterholoscan.resources.Transmitter 或 None

此输出端口使用的发送器。如果端口不存在,则为 None。

class holoscan.conditions.MultiMessageAvailableTimeoutCondition

基类:holoscan.gxf._gxf.GXFCondition

检查多个输入中可用消息数量的条件。

此条件用于检查多个输入端口是否有足够数量的消息可用。它可以以两种模式之一运行。

  1. SUM_OF_ALL: 此条件检查所有输入端口可用的消息总和

是否大于或等于给定的阈值。 对于此模式,应指定 min_sum

  1. PER_RECEIVER: 此条件检查每个输入端口可用的消息数量

是否大于或等于给定的阈值。 对于此模式,应指定 min_sizes

参数
fragmentholoscan.core.Fragment

条件将与之关联的 Fragment

execution_frequencystd::string

“execution frequency”(执行频率)指示实体将被允许再次执行的时间量,即使尚未收到指定数量的消息也是如此。 周期指定为一个字符串,其中包含一个数字和一个(可选)单位。 如果未给出单位,则假定该值以纳秒为单位。 支持的单位为:Hz、s、ms。 示例:“10ms”、“10000000”、“0.2s”、“50Hz”。

sampling_mode{“SumOfAll”, “PerReceiver”} 或 MultiMessageAvailableTimeoutCondition.SamplingMode,可选

在检查接收器队列中的消息时使用的采样方法。

min_sumint,可选

如果所有接收器的消息计数总和至少具有给定数量的可用消息,则此条件允许执行。 此选项仅适用于 “SumOfAll” sampling_mode

min_sizeslist of int,可选

如果所有给定的接收器在此列表中至少具有给定数量的可用消息,则此条件允许执行。 此选项仅适用于 “PerReceiver” sampling_modemin_sizes 的长度必须与与条件关联的接收器数量匹配。

namestr, optional

条件的名称。

注释

此条件通常通过 Operator.multi_port_condition 方法使用 ConditionType.MULTI_MESSAGE_AVAILABLE_TIMEOUT 设置。 “receivers” 参数必须根据 “Parameters” 部分中描述的输入端口名称进行设置。

此条件也可以在单个端口上使用,作为一种具有消息可用条件且还支持超时间隔的方式。 对于此单个输入端口用例,可以使用条件类型 ConditionType.MULTI_MESSAGE_AVAILABLE_TIMEOUT,在 IOSpec.condition 方法中使用 Operator.setup 添加条件。 在这种情况下,输入端口已从 IOSpec 对象中得知,因此 “receivers” 参数是不必要的。

属性

args 与组件关联的参数列表。
condition_type 条件类型。
description 描述条件的 YAML 格式字符串。
fragment 条件所属的 Fragment。
gxf_cid GXF 组件 ID。
gxf_cname 组件的名称。
gxf_context 组件的 GXF 上下文。
gxf_eid GXF 实体 ID。
gxf_typename 组件的 GXF 类型名称。
id 组件的标识符。
name 条件的名称。
receivers 与条件关联的接收器。

spec

方法

add_arg(*args, **kwargs) 重载函数。
gxf_initialize(self) 初始化组件。
initialize(self) 条件的初始化方法。
receiver(self, port_name) 获取与此条件关联的操作器的输入端口使用的接收器。
setup(self, arg0) 条件的设置方法。
transmitter(self, port_name) 获取与此条件关联的操作器的输出端口使用的发送器。

ConditionComponentType
SamplingMode

class ConditionComponentType

基类:pybind11_builtins.pybind11_object

成员

NATIVE

GXF

属性

name

value
GXF = <ConditionComponentType.GXF: 1>
NATIVE = <ConditionComponentType.NATIVE: 0>
__init__(self: holoscan.core._core.Condition.ConditionComponentType, value: int) → None
property name
property value
class SamplingMode

基类:pybind11_builtins.pybind11_object

成员

SUM_OF_ALL

PER_RECEIVER

属性

name

value
PER_RECEIVER = <SamplingMode.PER_RECEIVER: 1>
SUM_OF_ALL = <SamplingMode.SUM_OF_ALL: 0>
__init__(self: holoscan.conditions._conditions.MultiMessageAvailableCondition.SamplingMode, value: int) → None
property name
property value
__init__(self: holoscan.conditions._conditions.MultiMessageAvailableTimeoutCondition, fragment: holoscan.core._core.Fragment, execution_frequency: str, sampling_mode: Union[holoscan.conditions._conditions.MultiMessageAvailableCondition.SamplingMode, str] = <SamplingMode.SUM_OF_ALL: 0>, min_sum: Optional[int] = None, min_sizes: Optional[list[int]] = None, name: str = 'multi_message_timeout_condition') → None

检查多个输入中可用消息数量的条件。

此条件用于检查多个输入端口是否有足够数量的消息可用。它可以以两种模式之一运行。

  1. SUM_OF_ALL: 此条件检查所有输入端口可用的消息总和

是否大于或等于给定的阈值。 对于此模式,应指定 min_sum

  1. PER_RECEIVER: 此条件检查每个输入端口可用的消息数量

是否大于或等于给定的阈值。 对于此模式,应指定 min_sizes

参数
fragmentholoscan.core.Fragment

条件将与之关联的 Fragment

execution_frequencystd::string

“execution frequency”(执行频率)指示实体将被允许再次执行的时间量,即使尚未收到指定数量的消息也是如此。 周期指定为一个字符串,其中包含一个数字和一个(可选)单位。 如果未给出单位,则假定该值以纳秒为单位。 支持的单位为:Hz、s、ms。 示例:“10ms”、“10000000”、“0.2s”、“50Hz”。

sampling_mode{“SumOfAll”, “PerReceiver”} 或 MultiMessageAvailableTimeoutCondition.SamplingMode,可选

在检查接收器队列中的消息时使用的采样方法。

min_sumint,可选

如果所有接收器的消息计数总和至少具有给定数量的可用消息,则此条件允许执行。 此选项仅适用于 “SumOfAll” sampling_mode

min_sizeslist of int,可选

如果所有给定的接收器在此列表中至少具有给定数量的可用消息,则此条件允许执行。 此选项仅适用于 “PerReceiver” sampling_modemin_sizes 的长度必须与与条件关联的接收器数量匹配。

namestr, optional

条件的名称。

注释

此条件通常通过 Operator.multi_port_condition 方法使用 ConditionType.MULTI_MESSAGE_AVAILABLE_TIMEOUT 设置。 “receivers” 参数必须根据 “Parameters” 部分中描述的输入端口名称进行设置。

此条件也可以在单个端口上使用,作为一种具有消息可用条件且还支持超时间隔的方式。 对于此单个输入端口用例,可以使用条件类型 ConditionType.MULTI_MESSAGE_AVAILABLE_TIMEOUT,在 IOSpec.condition 方法中使用 Operator.setup 添加条件。 在这种情况下,输入端口已从 IOSpec 对象中得知,因此 “receivers” 参数是不必要的。

add_arg(*args, **kwargs)

重载函数。

  1. add_arg(self: holoscan.core._core.ComponentBase, arg: holoscan.core._core.Arg) -> None

向组件添加参数。

  1. add_arg(self: holoscan.core._core.ComponentBase, arg: holoscan.core._core.ArgList) -> None

向组件添加参数列表。

property args

与组件关联的参数列表。

返回
arglistholoscan.core.ArgList
property condition_type

条件类型。

holoscan.core.Condition.ConditionComponentType 枚举,表示条件的类型。当前实现的两种类型为 NATIVE 和 GXF。

property description

描述条件的 YAML 格式字符串。

property fragment

条件所属的 Fragment。

返回
nameholoscan.core.Fragment
property gxf_cid

GXF 组件 ID。

property gxf_cname

组件的名称。

property gxf_context

组件的 GXF 上下文。

property gxf_eid

GXF 实体 ID。

gxf_initialize(self: holoscan.gxf._gxf.GXFComponent) → None

初始化组件。

property gxf_typename

组件的 GXF 类型名称。

返回
str

组件的 GXF 类型名称。

property id

组件的标识符。

标识符最初设置为 -1,并在组件初始化后变为有效值。

使用默认执行器 (holoscan.gxf.GXFExecutor),标识符设置为 GXF 组件 ID。

返回
idint
initialize(self: holoscan.core._core.Condition) → None

条件的初始化方法。

property name

条件的名称。

返回
namestr
receiver(self: holoscan.core._core.Condition, port_name: str) → Optional[holoscan::Receiver]

获取与此条件关联的操作器的输入端口使用的接收器。

参数
port_namestr

输入端口的名称。

返回
receiverholoscan.resources.Receiver

此输入端口使用的接收器。如果端口不存在,则为 None。

property receivers

与条件关联的接收器。

setup(self: holoscan.core._core.Condition, arg0: holoscan.core._core.ComponentSpec) → None

条件的设置方法。

property spec
transmitter(self: holoscan.core._core.Condition, port_name: str) → Optional[holoscan::Transmitter]

获取与此条件关联的操作器的输出端口使用的发送器。

参数
port_namestr

输出端口的名称。

返回
transmitterholoscan.resources.Transmitter 或 None

此输出端口使用的发送器。如果端口不存在,则为 None。

class holoscan.conditions.PeriodicCondition

基类:holoscan.gxf._gxf.GXFCondition

用于支持操作器定期执行的条件类。“recess period”(暂停期)指示在再次执行 compute() 方法之前必须经过的最短时间量。暂停期可以指定为纳秒为单位的整数值。

例如:1000 表示 1 微秒,1000000 表示 1 毫秒,10000000000 表示 1 秒。

暂停期也可以指定为表示持续时间的 datetime.timedelta 对象。(请参阅 https://docs.pythonlang.cn/3/library/datetime.html#timedelta-objects

例如:datetime.timedelta(minutes=1)、datetime.timedelta(seconds=1)、datetime.timedelta(milliseconds=1) 和 datetime.timedelta(microseconds=1)。支持的参数名称为:weeks| days | hours | minutes | seconds | milliseconds | microseconds。 这需要 import datetime

参数
fragmentholoscan.core.Fragment

条件将与之关联的 Fragment

recess_periodint 或 datetime.timedelta

条件使用的暂停期值。 如果提供整数,则单位为纳秒。

namestr, optional

条件的名称。

属性

args 与组件关联的参数列表。
condition_type 条件类型。
description 描述条件的 YAML 格式字符串。
fragment 条件所属的 Fragment。
gxf_cid GXF 组件 ID。
gxf_cname 组件的名称。
gxf_context 组件的 GXF 上下文。
gxf_eid GXF 实体 ID。
gxf_typename 组件的 GXF 类型名称。
id 组件的标识符。
name 条件的名称。

spec

方法

add_arg(*args, **kwargs) 重载函数。
gxf_initialize(self) 初始化组件。
initialize(self) 条件的初始化方法。
last_run_timestamp(self) 获取表示上次运行时间戳的整数。
receiver(self, port_name) 获取与此条件关联的操作器的输入端口使用的接收器。
recess_period(*args, **kwargs) 重载函数。
recess_period_ns(self) 以纳秒为单位获取暂停期值。
setup(self, arg0) 条件的设置方法。
transmitter(self, port_name) 获取与此条件关联的操作器的输出端口使用的发送器。

ConditionComponentType

class ConditionComponentType

基类:pybind11_builtins.pybind11_object

成员

NATIVE

GXF

属性

name

value
GXF = <ConditionComponentType.GXF: 1>
NATIVE = <ConditionComponentType.NATIVE: 0>
__init__(self: holoscan.core._core.Condition.ConditionComponentType, value: int) → None
property name
property value
__init__(*args, **kwargs)

重载函数。

  1. __init__(self: holoscan.conditions._conditions.PeriodicCondition, fragment: holoscan.core._core.Fragment, recess_period: int, name: str = ‘noname_periodic_condition’) -> None

  2. __init__(self: holoscan.conditions._conditions.PeriodicCondition, fragment: holoscan.core._core.Fragment, recess_period: datetime.timedelta, name: str = ‘noname_periodic_condition’) -> None

用于支持操作器定期执行的条件类。“recess period”(暂停期)指示在再次执行 compute() 方法之前必须经过的最短时间量。暂停期可以指定为纳秒为单位的整数值。

例如:1000 表示 1 微秒,1000000 表示 1 毫秒,10000000000 表示 1 秒。

暂停期也可以指定为表示持续时间的 datetime.timedelta 对象。(请参阅 https://docs.pythonlang.cn/3/library/datetime.html#timedelta-objects

例如:datetime.timedelta(minutes=1)、datetime.timedelta(seconds=1)、datetime.timedelta(milliseconds=1) 和 datetime.timedelta(microseconds=1)。支持的参数名称为:weeks| days | hours | minutes | seconds | milliseconds | microseconds。 这需要 import datetime

参数
fragmentholoscan.core.Fragment

条件将与之关联的 Fragment

recess_periodint 或 datetime.timedelta

条件使用的暂停期值。 如果提供整数,则单位为纳秒。

namestr, optional

条件的名称。

add_arg(*args, **kwargs)

重载函数。

  1. add_arg(self: holoscan.core._core.ComponentBase, arg: holoscan.core._core.Arg) -> None

向组件添加参数。

  1. add_arg(self: holoscan.core._core.ComponentBase, arg: holoscan.core._core.ArgList) -> None

向组件添加参数列表。

property args

与组件关联的参数列表。

返回
arglistholoscan.core.ArgList
property condition_type

条件类型。

holoscan.core.Condition.ConditionComponentType 枚举,表示条件的类型。当前实现的两种类型为 NATIVE 和 GXF。

property description

描述条件的 YAML 格式字符串。

property fragment

条件所属的 Fragment。

返回
nameholoscan.core.Fragment
property gxf_cid

GXF 组件 ID。

property gxf_cname

组件的名称。

property gxf_context

组件的 GXF 上下文。

property gxf_eid

GXF 实体 ID。

gxf_initialize(self: holoscan.gxf._gxf.GXFComponent) → None

初始化组件。

property gxf_typename

组件的 GXF 类型名称。

返回
str

组件的 GXF 类型名称。

property id

组件的标识符。

标识符最初设置为 -1,并在组件初始化后变为有效值。

使用默认执行器 (holoscan.gxf.GXFExecutor),标识符设置为 GXF 组件 ID。

返回
idint
initialize(self: holoscan.core._core.Condition) → None

条件的初始化方法。

last_run_timestamp(self: holoscan.conditions._conditions.PeriodicCondition) → int

获取表示上次运行时间戳的整数。

property name

条件的名称。

返回
namestr
receiver(self: holoscan.core._core.Condition, port_name: str) → Optional[holoscan::Receiver]

获取与此条件关联的操作器的输入端口使用的接收器。

参数
port_namestr

输入端口的名称。

返回
receiverholoscan.resources.Receiver

此输入端口使用的接收器。如果端口不存在,则为 None。

recess_period(*args, **kwargs)

重载函数。

  1. recess_period(self: holoscan.conditions._conditions.PeriodicCondition, arg0: int) -> None

设置与条件关联的暂停期。 暂停期可以指定为纳秒为单位的整数值或表示持续时间的 datetime.timedelta 对象。

  1. recess_period(self: holoscan.conditions._conditions.PeriodicCondition, arg0: datetime.timedelta) -> None

设置与条件关联的暂停期。 暂停期可以指定为纳秒为单位的整数值或表示持续时间的 datetime.timedelta 对象。

recess_period_ns(self: holoscan.conditions._conditions.PeriodicCondition) → int

以纳秒为单位获取暂停期值。

setup(self: holoscan.core._core.Condition, arg0: holoscan.core._core.ComponentSpec) → None

条件的设置方法。

property spec
transmitter(self: holoscan.core._core.Condition, port_name: str) → Optional[holoscan::Transmitter]

获取与此条件关联的操作器的输出端口使用的发送器。

参数
port_namestr

输出端口的名称。

返回
transmitterholoscan.resources.Transmitter 或 None

此输出端口使用的发送器。如果端口不存在,则为 None。

Previous Holoscan Python API
Next holoscan.core
© 版权所有 2022-2024,NVIDIA。 上次更新于 2025 年 1 月 27 日。