Chapter 6
Vectorized Code Generation
©
National Instruments Corporation
6-27
------ Swap state pointers. ------
XTMP := X;
X := XD;
XD := XTMP;
INIT := FALSE;
end;
Vectorization of the BlockScript Block
The general BlockScript block is commonly used to implement very
complicated or custom algorithms within a single block. A major limitation
was the so-called soft-index limitation that occurred when generating code.
The soft-index limitation existed because BlockScript represented inputs
and outputs as vectors while AutoCode generated scalars. Therefore, you
could not use a run-time computed subscript (that is, soft) index for inputs
and outputs.
With vectorization, the soft-subscript limitation is gone, as the inputs and
outputs of the block are arrays. That means that the connectivity of the
inputs matches the input groups specified in the BlockScript code.
Note
Even with arrays, it is still possible to have the soft-subscript limitation for the
inputs. The last determining factor is how the inputs to the block are connected. If the
inputs to the BlockScript block are scalars rather than an array, the soft-subscript limitation
will apply.
The following is a list of limitations and features of the general BlockScript
block as applied to vectorized code generation.
•
It is an error to use both soft-subscript and scalar code generation.
•
Only 8-nested loops are supported.
•
Bounds checks are not performed for a soft-subscript array access.
•
While loops do not support a soft-subscript for inputs or outputs.
•
A soft-subscript expression of an input or output array is not supported
outside of a For loop.
For more information about the BlockScript block, refer to the
section of Chapter 5,