Chapter 6
Vectorized Code Generation
©
National Instruments Corporation
6-19
The two producer gain blocks (top, bottom) vectorize as expected. The
(gain..99) does not vectorize well. Notice that AutoCode was only able to
vectorize two inputs while the remaining four were unrolled.
AutoCode does not attempt to reconnect your diagram to generate better
vectorized code. Two design-level solutions can be applied to eliminate the
split vector problem:
•
Change the design so that the inputs naturally form the array, that is,
merging multiple blocks into one block.
•
Change to introduce blocks that merge data.
Merge
Merge is effectively a copy of sparsely connected data into a single array.
There is no special block to perform this because the gain block with unity
gain parameters performs this task perfectly. Consider the model shown in
Figure 6-5 that is similar to Example 6-7, and the generated code in
Example 6-8.
Figure 6-5.
Complete Split-Merge Diagram