Misplaced Pages

Gather/scatter (vector addressing): Difference between revisions

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
Browse history interactively← Previous editNext edit →Content deleted Content addedVisualWikitext
Revision as of 14:30, 26 August 2016 editFmadd (talk | contribs)Extended confirmed users10,468 editsNo edit summary← Previous edit Revision as of 00:14, 17 February 2017 edit undoPrimefac (talk | contribs)Edit filter managers, Autopatrolled, Bureaucrats, Checkusers, Oversighters, Administrators209,642 editsm Reverted edits by Fmadd (talk) to last version by Ralph CorderoyNext 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 ], with gather involving indexed vector-equivalent of register indirect addressing, 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 00:14, 17 February 2017

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 y {\displaystyle y} holding N {\displaystyle N} non-empty elements can be represented by two densely-populated vectors of length N {\displaystyle N} ; x {\displaystyle x} containing the non-empty elements of y {\displaystyle y} , and i d x {\displaystyle idx} giving the index in y {\displaystyle y} where x {\displaystyle x} 's element is located. The gather of y {\displaystyle y} into x {\displaystyle x} , denoted x y | x {\displaystyle x\leftarrow y|_{x}} , assigns x ( i ) = y ( i d x ( i ) ) {\displaystyle x(i)=y(idx(i))} with i d x {\displaystyle idx} having already been calculated. A C implementation is

for (i=0; i<N; ++i)
  x = y];

Scatter

The sparse scatter, denoted y | x x {\displaystyle y|_{x}\leftarrow x} is the reverse operation. It copies the values of x {\displaystyle x} into the corresponding locations in the sparsely-populated vector y {\displaystyle y} , i.e. y ( i d x ( i ) ) = x ( i ) {\displaystyle y(idx(i))=x(i)} .

for (i=0; i<N; ++i)
  y] = x;

See also

References

  1. BLAS Technical Forum standard, Chapter 3: Sparse BLAS.
Category: