Changes between Version 2 and Version 3 of VectorComputing


Ignore:
Timestamp:
Nov 21, 2010 12:57:28 PM (3 years ago)
Author:
guest
Comment:

example of a vector algorithm for computing the cumulative sum

Legend:

Unmodified
Added
Removed
Modified
  • VectorComputing

    v2 v3  
    22 
    33This page is to collect notes about adding vector instructions to GHC. 
     4 
     5In contrast to pure SIMD (single instruction multiple data) parallel computing as found in GPUs, 
     6vector processing includes permutation of vector elements which 
     7allows for certain efficient algorithms 
     8(see Guy Blelloch: [http://www.cs.cmu.edu/afs/cs.cmu.edu/project/scandal/public/papers/CMU-CS-90-190.html Prefix Sums and Their Applications]) 
     9that reduce computation from n scalar operations to log n vector operations using vectors of size n. 
     10Example: Compute the cumulative sum of a 4-element vector using a shift operation 
     11that shifts elements and clears unused elements: 
     12 
     13{{{ 
     14v0 = [x0, x1, x2, x3] 
     15v1 = v0 + shiftr 1 v0  -- v1 = [x0, x0+x1, x1+x2, x2+x3] 
     16v2 = v1 + shiftr 2 v1  -- v2 = [x0, x0+x1, x0+x1+x2, x0+x1+x2+x3] 
     17}}} 
    418 
    519A number of processors support vector operations.