Operator CASE

Operator Library: Logic

CASE 算子对多个相同格式的输入链路进行多路复用。 输入链路的数量必须在模块实例化时进行选择,并决定输入链路 "Switch" 的 Bit Width。 "Switch" 输入链路上的值决定了选择哪个输入链路并将其转发到输出端。 当 Switch 输入选择了不存在的输入链路时,算子的输出变为零。 该算子可与 kernels 一起使用。每个 kernel 组件都是独立选择的。

I/O Property

Property 值
Operator Type O
输入链路 I0,数据输入
I1..In-1,数据输入
Switch,数据输入
Output Link O,数据输出

Supported Link Format

Link Parameter 输入链接 I0 输入链接 I1..In-1 输入链路 Switch Output Link O
Bit Width [1, 64]1 作为 I0 auto2 作为 I0
Arithmetic {unsigned, signed} 作为 I0 unsigned 作为 I0
Parallelism any 作为 I0 作为 I0 作为 I0
Kernel Columns any 作为 I0 作为 I0 作为 I0
Kernel Rows any 作为 I0 作为 I0 作为 I0
Img Protocol {VALT_IMAGE2D, VALT_LINE1D, VALT_PIXEL0D, VALT_SIGNAL}3 作为 I0 作为 I0 作为 I0
Color Format any 作为 I0 VAF_GRAY 作为 I0
Color Flavor any 作为 I0 FL_NONE 作为 I0
Max. Img Width any 作为 I0 作为 I0 作为 I0
Max. Img Height any 作为 I0 作为 I0 作为 I0

1

对于无符号值,输入 Bit Width 的范围是 [1, 64]。 对于有符号输入,范围是 [2, 64]。 对于无符号彩色输入,范围是 [3, 63],对于有符号彩色,范围是 [6, 63]。

3

如果使用 image protocol VALT_SIGNAL,则只能寻址和使用 2 个输入。

2

switch 输入的 Bit Width 是根据输入链路数量 n 自动确定的

参数

无

使用示例

以下示例展示了 CASE 算子的使用: