Revision as of 14:23, 26 August 2016 editRalph Corderoy (talk | contribs)Extended confirmed users587 edits Clarify that y is sparsely populated, and x is densely packed, and that no elements of x are skipped on scatter.← Previous edit | Revision as of 14:30, 26 August 2016 edit undoFmadd (talk | contribs)Extended confirmed users10,468 editsNo edit summaryNext edit → | ||
Line 3: | Line 3: | ||
'''Gather-scatter''' is a type of memory addressing that often arises when addressing | '''Gather-scatter''' is a type of memory addressing that often arises when addressing | ||
vectors in ] ] operations. It is the | vectors in ] ] operations. It is the | ||
vector-equivalent of register indirect addressing, with gather involving indexed | vector-equivalent of ], with gather involving indexed | ||
reads and scatter indexed writes. ]s (and some ] units in ]s) have | reads and scatter indexed writes. ]s (and some ] units in ]s) have | ||
hardware support for gather-scatter operations, providing instructions such as | hardware support for gather-scatter operations, providing instructions such as |
Revision as of 14:30, 26 August 2016
This article is about the vector addressing type. For the I/O method, see Vectored I/O.Gather-scatter is a type of memory addressing that often arises when addressing vectors in sparse linear algebra operations. It is the vector-equivalent of register indirect addressing, with gather involving indexed reads and scatter indexed writes. Vector processors (and some SIMD units in CPUs) have hardware support for gather-scatter operations, providing instructions such as Load Vector Indexed for gather and Store Vector Indexed for scatter.
Definitions
Gather
A sparsely-populated vector holding non-empty elements can be represented by two densely-populated vectors of length ; containing the non-empty elements of , and giving the index in where 's element is located. The gather of into , denoted , assigns with having already been calculated. A C implementation is
for (i=0; i<N; ++i) x = y];
Scatter
The sparse scatter, denoted is the reverse operation. It copies the values of into the corresponding locations in the sparsely-populated vector , i.e. .
for (i=0; i<N; ++i) y] = x;