Technical data
Vector Processing Concepts
1.7 STRIDE
To a vector processor, a vector in memory is characterized by a start
location, a length, and a stride. Stride is a measure of the number of
memory locations between consecutive elements of a vector. A stride
equal to the size of one vector element, known as unity stride, means that
the vector elements are contiguous in memory. A constant stride greater
than the size of one element means that the elements are noncontiguous
but are evenly spaced in memory (see Figure 1–5). Most vector processors
can load and store vectors that have constant stride.
Not all vector data is constant-strided, however. In some vectors, the
distance between consecutive elements in memory is not constant but
varies for each pair of elements. Such vectors can be scattered throughout
memory and are said to be random-strided or nonstrided (see Figure 1–6).
For example, a sparse matrix is generally treated as a nonstrided vector.
Some earlier vector processors did not support this kind of vector. On
those systems, special software routines were required to gather the
nonstrided vector into a temporary contiguous vector that could be
accessed by constant-strided vector memory instructions.
Today, most vector processors support nonstrided vectors with special load
and store instructions called gather and scatter.
1–15