Operator MergeParallel

Operator Library: Base

该算子通过将输入链路级联到 Parallelism 组件,将 N 个输入链路合并为单个输出链路。 以下图片阐释了 2 种情况:在情况 A 中,合并了 3 个 Parallelism 为 1 的输入链路。 在情况 B 中,合并了 3 个 Parallelism 为 2 的输入链路。

输入的并行像素被级联到 Parallelism 为 3 的单个输出链路。 输入链路顺序决定了并行输出中相应像素的位置。

请注意,此情况下的输入像素也会级联到并行输出,而不会进行交织。 3 个 Parallelism 为 2 的输入链路被级联到 Parallelism 为 6 的输出链路。

I/O Property

Property 值
Operator Type O
输入链路 I0,数据输入
I[n],n > 0,数据输入
Output Link O,数据输出

Supported Link Format

Link Parameter 输入链接 I0 输入链路 I[n],n > 0 Output Link O
Bit Width [1, 64]1 作为 I0 作为 I0
Arithmetic {unsigned, signed} 作为 I0 作为 I0
Parallelism any 作为 I0 auto2
Kernel Columns any 作为 I0 作为 I0
Kernel Rows any 作为 I0 作为 I0
Img Protocol {VALT_IMAGE2D, VALT_LINE1D, VALT_PIXEL0D} 作为 I0 作为 I0
Color Format any 作为 I0 作为 I0
Color Flavor any 作为 I0 作为 I0
Max. Img Width any 作为 I0 auto3
Max. Img Height any 作为 I0 作为 I0

1

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

2

输出的 Parallelism 是所有输入链路的输入 Parallelism 之和。

3

输出的最大图像宽度是所有输入链路的最大图像宽度之和。

参数

MergeMode
键入 static 参数
默认 Append
范围 {Append, Interleave}

此参数定义了输入链路中的像素在输出链路中的排列方式。

Append:追加每个输入链路的所有并行像素。

示例: 如果您有 3 个 Parallelism 为 2 的输入链路,则会得到一个 Parallelism 为 6 的输出链路。前 2 个像素取自 I0,接着是来自 I1 的 2 个像素,最后是来自 I2 的 2 个像素。

Interleave:在输入链路之间以循环轮询(round-robin)方式交织像素。

示例: 如果您有 3 个 Parallelism 为 2 的输入链路,则会得到一个 Parallelism 为 6 的输出链路。输出链路中的并行像素排列如下: I0 的像素 0、I1 的像素 0、I2 的像素 0、I0 的像素 1、I1 的像素 1,最后是 I2 的像素 1。

使用示例

以下示例展示了算子 MergeParallel 的用法: