Download presentation
Presentation is loading. Please wait.
Published byJayson Norris Modified over 8 years ago
1
1/16 CALCULATING PREFIX SUMS Vladimir Jocovi ć 2012/0011
2
2/16 WHAT ARE ALL-PREFIX SUMS? The all-prefix-sums operation takes: The all-prefix-sums operation takes: a binary associative operator ⊕ a binary associative operator ⊕ an ordered set of n elements [a0, a1,..., an − 1] an ordered set of n elements [a0, a1,..., an − 1] And returns the ordered set And returns the ordered set [a0, (a0 ⊕ a1),..., (a0 ⊕ a1 ⊕... ⊕ an − 1)] [a0, (a0 ⊕ a1),..., (a0 ⊕ a1 ⊕... ⊕ an − 1)] Inclusive type Inclusive type
3
3/16 WHAT ARE ALL-PREFIX SUMS? Example: Example: Operation ⊕ is addition Operation ⊕ is addition Input array - [3, 1, 7, 0, 4, 1, 6, 3] Input array - [3, 1, 7, 0, 4, 1, 6, 3] Would return: Would return: Output array - [3, 4, 11, 11, 15, 16, 22, 25] Output array - [3, 4, 11, 11, 15, 16, 22, 25]
4
4/16 WHERE ARE ALL-PREFIX SUMS USED? To lexically compare strings of characters To lexically compare strings of characters To evaluate polynomials To evaluate polynomials Sorting algorithms (radix sort, quicksort) Sorting algorithms (radix sort, quicksort)
5
5/16 HOW DOES THE HARDWARE LOOK LIKE? Graph representing PrefixSumKernel Io.input(“x”, type, …Io.output(“z”, type, … result = x + (cnt < loopVal?0:sum); Storing partial sum
6
6/16 HOW DOES THE HARDWARE LOOK LIKE? Graph representing PrefixSumKernel at its final step
7
7/16 HOW DOES THE HARDWARE LOOK LIKE? Manager graph
8
8/16 ALGORITHM
9
9/16 ALGORITHM
10
10/16 ALGORITHM
11
11/16 ALGORITHM
12
12/16 KERNEL CODE
13
13/16 BUILD AND RUN
14
14/16 CONCLUSION Poor maxeler results? Poor maxeler results? Just a simulation, not a real hardware Just a simulation, not a real hardware
15
15/16 REFERENCES http://www.st.ewi.tudelft.nl/ - Delft University of Technology, Netherlands http://www.st.ewi.tudelft.nl/ - Delft University of Technology, Netherlands http://www.st.ewi.tudelft.nl/ www.cs.cmu.edu - Carnegie Mellon University, USA www.cs.cmu.edu - Carnegie Mellon University, USA www.cs.cmu.edu www.oerc.ox.ac.uk - Oxford e-Research Centre www.oerc.ox.ac.uk - Oxford e-Research Centre www.oerc.ox.ac.uk https://www.wikipedia.org/ - Wikipedia https://www.wikipedia.org/ - Wikipedia https://www.wikipedia.org/
16
16/16 QUESTIONS AND ANSWERS
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.