# ParPrefix - Prefix Sums(or Partial Sums Input a sequence of...

This preview shows pages 1–10. Sign up to view the full content.

Prefix Sums (or Partial Sums) Input: a sequence of n integers; a 0 , a 1 , …, a n -1 Output: a sequence of sums, s s i = a 0 + a 1 + … + a i = = i j j a 0

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Example: Input: 2, 8, 4, 7, 1, 1 Output: 2, 10, 14, 21, 22, 23
Sequential Algorithm Complexity: O ( n ) for n inputs s [0] a [0]; for i 0 to n-1 do s [ i ] s [ i – 1] + a [ i ];

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Partial Sums Pipeline a [ 0 ] = + + + a [ 1 ] a [ 2 ] a [ 3 ] p [ 0 ] p [ 1 ] p [ 2 ] p [ 0 ] p [ 1 ] p [ 2 ] p [ 3 ]
For Prefix Sum (or Partial Sum) See pages 172-73 in your textbook (Chapter 6)

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Data parallel method of adding all partial sums of 16 numbers 6.
Data parallel prefix sum operatio 6.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
x 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 1 x 1 + x 2 x 2 + x 3 x 3 + x 4 x 4 + x 5 x 5 + x 6 x 6 + x 7 x 7 + x 8 x 1 + x 2 x 1 x 1 + x 2 + x 3 x 1 + + x 4 x 1 + + x 5 x 1 + + x 6 x 1 + + x 7 x 1 + + x 8 p = n log n = 8 × 3 T p = log n = 3 Cost = n log 2 n
Synchronous Iteration (Synchronous Parallelism) Each iteration composed of several processes that start together at beginning of iteration. Next iteration cannot begin until all processes have finished previous iteration.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 05/12/2010 for the course CS CDA 5110- taught by Professor Deo during the Spring '10 term at University of Central Florida.

### Page1 / 22

ParPrefix - Prefix Sums(or Partial Sums Input a sequence of...

This preview shows document pages 1 - 10. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online