Download presentation
Presentation is loading. Please wait.
Published byKelley Taylor Modified over 9 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 Varbanescu, Ana Lucia, "Dataflow Programming with MaxCompiler," www.st.ewi.tudelft.nl, Delft University of Technology, Netherlands, 2015. www.st.ewi.tudelft.nl Blelloch, Guy E., "Prefix Sums and Their Applications," www.cs.cmu.edu, Carnegie Mellon University, USA, 2015. www.cs.cmu.edu Milutinovic, V., editor, "Computer Architecture," (Chapter 9, DataFlow Computation, Dennis, J.,), North Holland, 1988. Milutinovic, V., Salom, J., Trifunovic, N., Giorgi, R., "Guide to DataFlow SuperComputing," Springer, 2015. Milutinovic, V., editor, Advances in Computers: DataFlow, Elsevier, 2015.
16
16/16 QUESTIONS AND ANSWERS
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.