Operator CASE

Operator Library: Logic

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

I/O Property

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

支持的 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

如果使用 VALT_SIGNAL 图像协议,则只能寻址和使用 2 个输入。

2

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

参数

无

使用示例

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