PARALLEL PROCESSING UNIT 3. Dr. Ahmed Sallam

Size: px
Start display at page:

Download "PARALLEL PROCESSING UNIT 3. Dr. Ahmed Sallam"

Transcription

1 PARALLEL PROCESSING 1 UNIT 3 Dr. Ahmed Sallam

2 FUNDAMENTAL GPU ALGORITHMS More Patterns Reduce Scan 2

3 OUTLINES Efficiency Measure Reduce primitive Reduce model Reduce Implementation and complexity analysis Scan primitive Scan model Scan Implementation and complexity analysis Histogram primitive Histogram with atomic Histogram with atomic and reduce 3

4 4 EFFICIENCY MEASURE

5 SEQUENTIAL VS. PARALLEL EFFICIENCY? Sequential 1 Thread Parallel 3 Threads Steps Total Work 5 If = Work Efficient 21 5

6 OUTLINES Efficiency Measure Reduce Algorithm Reduce model Reduce Implementation and complexity analysis Scan Algorithm Scan model Scan Implementation and complexity analysis Histogram Algorithm Histogram with atomic Histogram with atomic and reduce 6

7 7 REDUCE PATTERN

8 REDUCE

9 REDUCE DEFINITION Set of elements Reduction operator Binary Associative operation

10 QUIZ Multiply ( a*b ) Minimum Factorial ( a! ) Logical Or ( a b ) Logical And ( a&&b ) Division ( a/b ) 10

11 REDUCE SERIAL (SEQUENTIAL) IMPLEMENTATION sum=0 For (i=1;i<n;i){ sum=sumarray[i]; } return sum; Steps = 3 Total work = 3 11

12 REDUCE SERIAL COMPLEXITY Which is true to reduce n elements? It takes n operation It takes n-1 operation It s work complexity O(n) It s step complexity O(n) 12

13 REDUCE PARALLEL IMPLEMENTATION (a(bc))d) = (ab)(cd) Steps = 2 Total work = 3 13

14 REDUCE PARALLEL COMPLEXITY N Steps Total work Actually If we have n elements we need n/2 threads at first step. But this is not possible because we have only p processors 8 3 = lg n O(log n) 7 = n-1 O(n) Thus O(log n) is not accurate 14 and we need another calculation this called Brent s theorm

15 REDUCE IN ACTION Suppose we have 2^20 (1m) elements Stage 1: 1024 block * 1024 thread Stage 2: 1 block B0 B1 --- PS: increase performance 3 times by using shared memory 1024 B0 Start 15

16 OUTLINES Efficiency Measure Reduce Algorithm Reduce model Reduce Implementation and complexity analysis Scan Algorithm Scan model Scan Implementation and complexity analysis Histogram Algorithm Histogram with atomic Histogram with atomic and reduce 16

17 17 SCAN PATTERN

18 SCAN Input: Op: add Output: Transaction Balance

19 SCAN DEFINITION Set of elements Reduction operator (op) Binary Associative operation (We assume here it s also commutative e.g. xy=yx) Identity element [I op a= a] op I Because 0 a0=a * 1 a*1=a min (unsigned char) 0xFF min(0xff,a)=a 19

20 SCAN DEFINITION CONT. Exclusive in : Op= I= 0 Out: Inclusive: in : Op= I= 0 Out:

21 SCAN SERIAL IMPLEMENTATION AND COMPLEXITY acc=identity For (i=1;i<n;i){ acc=accarray[i]; out[i]=acc; } return out; Inclusive acc=identity For (i=1;i<n;i){ out[i]=acc; acc=accarray[i]; } return out; Exclusive Steps = n Total work = n 21

22 SCAN PARALLEL IMPLEMENTATION AND COMPLEXITY Inclusive ( Scan): in : Out: So if we consider the problem a set of reduce problems with different n then: n Step Work 1 lg lg 2 1 n lg n n-1 22 =O ( log n) = O( n 2 )

23 SCAN PARALLEL IMPLEMENTATION AND COMPLEXITY (CONT.1) Method Step Work Hillis & Steele Blelloch 23

24 SCAN PARALLEL IMPLEMENTATION AND COMPLEXITY (CONT.2) Hillis & Steele (Inclusive sum scan): Step= O( log n ) work= matrix = O( n log n ) 24

25 SCAN PARALLEL IMPLEMENTATION AND COMPLEXITY (CONT.3) Blelloch(Exclusive sum scan): Reduce Step= log n Work= n Downsweep L R R LR Step= log n Work= n

26 QUIZ Which Scan algorithm to use? Method Serial Hillis & Steele Blelloch 512 elements 512 processor 1m elements 512 processor 128k elements 1 processor 26

27 OUTLINES Efficiency Measure Reduce Algorithm Reduce model Reduce Implementation and complexity analysis Scan Algorithm Scan model Scan Implementation and complexity analysis Histogram Algorithm Histogram with atomic Histogram with atomic and reduce 27

28 28 HISTOGRAM

29 HISTOGRAM Measure the students height in your class: < >180 How is shorter than 175? Cumulative distribution (Scan) 29

30 HISTOGRAM SERIAL IMPLEMENTATION In: measurements[], n-elements Out: result[] For (i=0; i<bin-count; i) result[i]=0; For (i=0; i< n-elements ; i) result[computebin(measurements[i])] 30

31 HISTOGRAM PARALLEL NAÏVE In: measurements[], n-elements Out: result[] For (i=0; i<bin-count; i) result[i]=0; For (i=0; i< n-elements ; i) result[computebin(measurements[i])] We have synchronization problem Start 31

32 HISTOGRAM PARALLEL NAÏVE (CONT.) Example 128 element 8 threads 3 bin Memory Thread 1 Thread 2 Read Increment Write Memory Register Race condition 32

33 HISTOGRAM PARALLEL SIMPLE Use atomic operation However this serialize the problem. 33

34 HISTOGRAM PARALLEL REDUCE BASE Example 128 element 8 threads 3 bin Use local bins, which means every thread had 3 local bin. Thread Bin Each thread accumulate 16 item Then apply a reduce back in global memory 34

35 HISTOGRAM PARALLEL REDUCE BASE Example 128 element 8 threads 3 bin Use local bins, which means every thread had 3 local bin. Thread Bin Each thread accumulate 16 item Then apply a reduce back in global memory 3 times for each bin (3 times is bad) 35

36 HISTOGRAM PARALLEL SORT & REDUCE Example 128 element 8 threads 3 bin Memory First we sort Memory Then we reduce 36

37 OUTLINES Efficiency Measure Reduce Algorithm Reduce model Reduce Implementation and complexity analysis Scan Algorithm Scan model Scan Implementation and complexity analysis Histogram Algorithm Histogram with atomic Histogram with atomic and reduce 37

38 TONE MAPPING 38

39 TONE MAPPING Using reduce, scan and histogram 39

Scan Primitives for GPU Computing

Scan Primitives for GPU Computing Scan Primitives for GPU Computing Agenda What is scan A naïve parallel scan algorithm A work-efficient parallel scan algorithm Parallel segmented scan Applications of scan Implementation on CUDA 2 Prefix

More information

AMS 148 Chapter 6: Histogram, Sort, and Sparse Matrices

AMS 148 Chapter 6: Histogram, Sort, and Sparse Matrices AMS 148 Chapter 6: Histogram, Sort, and Sparse Matrices Steven Reeves Now that we have completed the more fundamental parallel primitives on GPU, we will dive into more advanced topics. Histogram is a

More information

CS 179: GPU Programming. Lecture 7

CS 179: GPU Programming. Lecture 7 CS 179: GPU Programming Lecture 7 Week 3 Goals: More involved GPU-accelerable algorithms Relevant hardware quirks CUDA libraries Outline GPU-accelerated: Reduction Prefix sum Stream compaction Sorting(quicksort)

More information

Lecture 7. Transform-and-Conquer

Lecture 7. Transform-and-Conquer Lecture 7 Transform-and-Conquer 6-1 Transform and Conquer This group of techniques solves a problem by a transformation to a simpler/more convenient instance of the same problem (instance simplification)

More information

Parallel Patterns Ezio Bartocci

Parallel Patterns Ezio Bartocci TECHNISCHE UNIVERSITÄT WIEN Fakultät für Informatik Cyber-Physical Systems Group Parallel Patterns Ezio Bartocci Parallel Patterns Think at a higher level than individual CUDA kernels Specify what to compute,

More information

Data-Parallel Algorithms on GPUs. Mark Harris NVIDIA Developer Technology

Data-Parallel Algorithms on GPUs. Mark Harris NVIDIA Developer Technology Data-Parallel Algorithms on GPUs Mark Harris NVIDIA Developer Technology Outline Introduction Algorithmic complexity on GPUs Algorithmic Building Blocks Gather & Scatter Reductions Scan (parallel prefix)

More information

CS377P Programming for Performance GPU Programming - II

CS377P Programming for Performance GPU Programming - II CS377P Programming for Performance GPU Programming - II Sreepathi Pai UTCS November 11, 2015 Outline 1 GPU Occupancy 2 Divergence 3 Costs 4 Cooperation to reduce costs 5 Scheduling Regular Work Outline

More information

Scan Algorithm Effects on Parallelism and Memory Conflicts

Scan Algorithm Effects on Parallelism and Memory Conflicts Scan Algorithm Effects on Parallelism and Memory Conflicts 11 Parallel Prefix Sum (Scan) Definition: The all-prefix-sums operation takes a binary associative operator with identity I, and an array of n

More information

GPU Programming. Parallel Patterns. Miaoqing Huang University of Arkansas 1 / 102

GPU Programming. Parallel Patterns. Miaoqing Huang University of Arkansas 1 / 102 1 / 102 GPU Programming Parallel Patterns Miaoqing Huang University of Arkansas 2 / 102 Outline Introduction Reduction All-Prefix-Sums Applications Avoiding Bank Conflicts Segmented Scan Sorting 3 / 102

More information

GPGPU: Parallel Reduction and Scan

GPGPU: Parallel Reduction and Scan Administrivia GPGPU: Parallel Reduction and Patrick Cozzi University of Pennsylvania CIS 565 - Spring 2011 Assignment 3 due Wednesday 11:59pm on Blackboard Assignment 4 handed out Monday, 02/14 Final Wednesday

More information

EE/CSCI 451: Parallel and Distributed Computation

EE/CSCI 451: Parallel and Distributed Computation EE/CSCI 451: Parallel and Distributed Computation Lecture #7 2/5/2017 Xuehai Qian Xuehai.qian@usc.edu http://alchem.usc.edu/portal/xuehaiq.html University of Southern California 1 Outline From last class

More information

ORGANIZING THE DATA IN A FREQUENCY TABLE

ORGANIZING THE DATA IN A FREQUENCY TABLE ORGANIZING THE DATA IN A FREQUENCY TABLE Suppose the scores obtained by 5 students on a standardized test are as follows: 68, 55, 61, 55, 43, 59, 55, 58, 77, 6, 56, 53, 58, 7, 57, 62, 5, 69, 44, 63, 48,79,

More information

Parallel Prefix Sum (Scan) with CUDA. Mark Harris

Parallel Prefix Sum (Scan) with CUDA. Mark Harris Parallel Prefix Sum (Scan) with CUDA Mark Harris mharris@nvidia.com March 2009 Document Change History Version Date Responsible Reason for Change February 14, 2007 Mark Harris Initial release March 25,

More information

Fundamentals of the Analysis of Algorithm Efficiency

Fundamentals of the Analysis of Algorithm Efficiency Fundamentals of the Analysis of Algorithm Efficiency DR. JIRABHORN CHAIWONGSAI ดร.จ ราพร ไชยวงศ สาย D E PA R T M E N T O F C O M P U T E R E N G I N E E R I N G S C H O O L O F I N F O R M AT I O N A N

More information

CS433 Homework 6. Problem 1 [15 points] Assigned on 11/28/2017 Due in class on 12/12/2017

CS433 Homework 6. Problem 1 [15 points] Assigned on 11/28/2017 Due in class on 12/12/2017 CS433 Homework 6 Assigned on 11/28/2017 Due in class on 12/12/2017 Instructions: 1. Please write your name and NetID clearly on the first page. 2. Refer to the course fact sheet for policies on collaboration.

More information

CSC Design and Analysis of Algorithms

CSC Design and Analysis of Algorithms CSC : Lecture 7 CSC - Design and Analysis of Algorithms Lecture 7 Transform and Conquer I Algorithm Design Technique CSC : Lecture 7 Transform and Conquer This group of techniques solves a problem by a

More information

CUDA Advanced Techniques 3 Mohamed Zahran (aka Z)

CUDA Advanced Techniques 3 Mohamed Zahran (aka Z) Some slides are used and slightly modified from: NVIDIA teaching kit CSCI-GA.3033-004 Graphics Processing Units (GPUs): Architecture and Programming CUDA Advanced Techniques 3 Mohamed Zahran (aka Z) mzahran@cs.nyu.edu

More information

Scan and its Uses. 1 Scan. 1.1 Contraction CSE341T/CSE549T 09/17/2014. Lecture 8

Scan and its Uses. 1 Scan. 1.1 Contraction CSE341T/CSE549T 09/17/2014. Lecture 8 CSE341T/CSE549T 09/17/2014 Lecture 8 Scan and its Uses 1 Scan Today, we start by learning a very useful primitive. First, lets start by thinking about what other primitives we have learned so far? The

More information

CSC Design and Analysis of Algorithms. Lecture 7. Transform and Conquer I Algorithm Design Technique. Transform and Conquer

CSC Design and Analysis of Algorithms. Lecture 7. Transform and Conquer I Algorithm Design Technique. Transform and Conquer // CSC - Design and Analysis of Algorithms Lecture 7 Transform and Conquer I Algorithm Design Technique Transform and Conquer This group of techniques solves a problem by a transformation to a simpler/more

More information

Parallel Computing: Parallel Algorithm Design Examples Jin, Hai

Parallel Computing: Parallel Algorithm Design Examples Jin, Hai Parallel Computing: Parallel Algorithm Design Examples Jin, Hai School of Computer Science and Technology Huazhong University of Science and Technology ! Given associative operator!! a 0! a 1! a 2!! a

More information

Lecture 23: Parallelism. To Use Library. Getting Good Results. CS 62 Fall 2016 Kim Bruce & Peter Mawhorter

Lecture 23: Parallelism. To Use Library. Getting Good Results. CS 62 Fall 2016 Kim Bruce & Peter Mawhorter Lecture 23: Parallelism CS 62 Fall 2016 Kim Bruce & Peter Mawhorter Some slides based on those from Dan Grossman, U. of Washington To Use Library Getting Good Results Create a ForkJoinPool Instead of subclass

More information

Transform & Conquer. Presorting

Transform & Conquer. Presorting Transform & Conquer Definition Transform & Conquer is a general algorithm design technique which works in two stages. STAGE : (Transformation stage): The problem s instance is modified, more amenable to

More information

Floating-point Precision vs Performance Trade-offs

Floating-point Precision vs Performance Trade-offs Floating-point Precision vs Performance Trade-offs Wei-Fan Chiang School of Computing, University of Utah 1/31 Problem Statement Accelerating computations using graphical processing units has made significant

More information

Scan Primitives for GPU Computing

Scan Primitives for GPU Computing Scan Primitives for GPU Computing Shubho Sengupta, Mark Harris *, Yao Zhang, John Owens University of California Davis, *NVIDIA Corporation Motivation Raw compute power and bandwidth of GPUs increasing

More information

Parallel Programming. Easy Cases: Data Parallelism

Parallel Programming. Easy Cases: Data Parallelism Parallel Programming The preferred parallel algorithm is generally different from the preferred sequential algorithm Compilers cannot transform a sequential algorithm into a parallel one with adequate

More information

Parallel Sorting Algorithms

Parallel Sorting Algorithms CSC 391/691: GPU Programming Fall 015 Parallel Sorting Algorithms Copyright 015 Samuel S. Cho Sorting Algorithms Review Bubble Sort: O(n ) Insertion Sort: O(n ) Quick Sort: O(n log n) Heap Sort: O(n log

More information

Quick-Sort. Quick-Sort 1

Quick-Sort. Quick-Sort 1 Quick-Sort 7 4 9 6 2 2 4 6 7 9 4 2 2 4 7 9 7 9 2 2 9 9 Quick-Sort 1 Outline and Reading Quick-sort ( 4.3) Algorithm Partition step Quick-sort tree Execution example Analysis of quick-sort (4.3.1) In-place

More information

ISA 563 : Fundamentals of Systems Programming

ISA 563 : Fundamentals of Systems Programming ISA 563 : Fundamentals of Systems Programming Variables, Primitive Types, Operators, and Expressions September 4 th 2008 Outline Define Expressions Discuss how to represent data in a program variable name

More information

CSc 110, Spring 2017 Lecture 39: searching

CSc 110, Spring 2017 Lecture 39: searching CSc 110, Spring 2017 Lecture 39: searching 1 Sequential search sequential search: Locates a target value in a list (may not be sorted) by examining each element from start to finish. Also known as linear

More information

Basic operators, Arithmetic, Relational, Bitwise, Logical, Assignment, Conditional operators. JAVA Standard Edition

Basic operators, Arithmetic, Relational, Bitwise, Logical, Assignment, Conditional operators. JAVA Standard Edition Basic operators, Arithmetic, Relational, Bitwise, Logical, Assignment, Conditional operators JAVA Standard Edition Java - Basic Operators Java provides a rich set of operators to manipulate variables.

More information

9. Which situation is true regarding a cascading cut that produces c trees for a Fibonacci heap?

9. Which situation is true regarding a cascading cut that produces c trees for a Fibonacci heap? 1 1 Name Test 1 - Closed Book Student ID # Multiple Choice. Write your answer to the LEFT of each problem. points each 1. During which operation on a leftist heap may subtree swaps be needed? A. DECREASE-KEY

More information

CSC Design and Analysis of Algorithms. Lecture 8. Transform and Conquer II Algorithm Design Technique. Transform and Conquer

CSC Design and Analysis of Algorithms. Lecture 8. Transform and Conquer II Algorithm Design Technique. Transform and Conquer CSC 301- Design and Analysis of Algorithms Lecture Transform and Conquer II Algorithm Design Technique Transform and Conquer This group of techniques solves a problem by a transformation to a simpler/more

More information

Lesson 1 1 Introduction

Lesson 1 1 Introduction Lesson 1 1 Introduction The Multithreaded DAG Model DAG = Directed Acyclic Graph : a collection of vertices and directed edges (lines with arrows). Each edge connects two vertices. The final result of

More information

CS433 Homework 6. Problem 1 [15 points] Assigned on 11/28/2017 Due in class on 12/12/2017

CS433 Homework 6. Problem 1 [15 points] Assigned on 11/28/2017 Due in class on 12/12/2017 CS433 Homework 6 Assigned on 11/28/2017 Due in class on 12/12/2017 Instructions: 1. Please write your name and NetID clearly on the first page. 2. Refer to the course fact sheet for policies on collaboration.

More information

Data parallel algorithms, algorithmic building blocks, precision vs. accuracy

Data parallel algorithms, algorithmic building blocks, precision vs. accuracy Data parallel algorithms, algorithmic building blocks, precision vs. accuracy Robert Strzodka Architecture of Computing Systems GPGPU and CUDA Tutorials Dresden, Germany, February 25 2008 2 Overview Parallel

More information

CS671 Parallel Programming in the Many-Core Era

CS671 Parallel Programming in the Many-Core Era CS671 Parallel Programming in the Many-Core Era Lecture 3: GPU Programming - Reduce, Scan & Sort Zheng Zhang Rutgers University Review: Programming with CUDA An Example in C Add vector A and vector B to

More information

Database Applications (15-415)

Database Applications (15-415) Database Applications (15-415) DBMS Internals- Part VI Lecture 17, March 24, 2015 Mohammad Hammoud Today Last Two Sessions: DBMS Internals- Part V External Sorting How to Start a Company in Five (maybe

More information

Concurrent Processes Rab Nawaz Jadoon

Concurrent Processes Rab Nawaz Jadoon Concurrent Processes Rab Nawaz Jadoon DCS COMSATS Institute of Information Technology Assistant Professor COMSATS Lahore Pakistan Operating System Concepts Concurrent Processes If more than one threads

More information

Arithmetic and Bitwise Operations on Binary Data

Arithmetic and Bitwise Operations on Binary Data Arithmetic and Bitwise Operations on Binary Data CSCI 2400: Computer Architecture ECE 3217: Computer Architecture and Organization Instructor: David Ferry Slides adapted from Bryant & O Hallaron s slides

More information

Update on Angelic Programming synthesizing GPU friendly parallel scans

Update on Angelic Programming synthesizing GPU friendly parallel scans Update on Angelic Programming synthesizing GPU friendly parallel scans Shaon Barman, Sagar Jain, Nicholas Tung, Ras Bodik University of California, Berkeley Angelic programming and synthesis Angelic programming:

More information

CUB. collective software primitives. Duane Merrill. NVIDIA Research

CUB. collective software primitives. Duane Merrill. NVIDIA Research CUB collective software primitives Duane Merrill NVIDIA Research What is CUB?. A design model for collective primitives How to make reusable SIMT software constructs. A library of collective primitives

More information

( ) n 5. Test 1 - Closed Book

( ) n 5. Test 1 - Closed Book Name Test 1 - Closed Book Student ID # Multiple Choice. Write your answer to the LEFT of each problem. points each 1. During which operation on a leftist heap may subtree swaps be needed? A. DECREASE-KEY

More information

Lesson 1 4. Prefix Sum Definitions. Scans. Parallel Scans. A Naive Parallel Scans

Lesson 1 4. Prefix Sum Definitions. Scans. Parallel Scans. A Naive Parallel Scans Lesson 1 4 Prefix Sum Definitions Prefix sum given an array...the prefix sum is the sum of all the elements in the array from the beginning to the position, including the value at the position. The sequential

More information

C Language Part 2 Digital Computer Concept and Practice Copyright 2012 by Jaejin Lee

C Language Part 2 Digital Computer Concept and Practice Copyright 2012 by Jaejin Lee C Language Part 2 (Minor modifications by the instructor) 1 Scope Rules A variable declared inside a function is a local variable Each local variable in a function comes into existence when the function

More information

Discrete Element Method

Discrete Element Method Discrete Element Method Midterm Project: Option 2 1 Motivation NASA, loyalkng.com, cowboymining.com Industries: Mining Food & Pharmaceutics Film & Game etc. Problem examples: Collapsing Silos Mars Rover

More information

Prefix Scan and Minimum Spanning Tree with OpenCL

Prefix Scan and Minimum Spanning Tree with OpenCL Prefix Scan and Minimum Spanning Tree with OpenCL U. VIRGINIA DEPT. OF COMP. SCI TECH. REPORT CS-2013-02 Yixin Sun and Kevin Skadron Dept. of Computer Science, University of Virginia ys3kz@virginia.edu,

More information

Homework 1: Parallel Programming Basics Homework 1: Parallel Programming Basics Homework 1, cont.

Homework 1: Parallel Programming Basics Homework 1: Parallel Programming Basics Homework 1, cont. // CS9 Parallel Programming Lecture : Introduction to Parallel Algorithms Mary Hall August, 0 Homework : Parallel Programming Basics Turn in electronically on the CADE machines using the handin program:

More information

Chapter 3 Structured Program Development in C Part II

Chapter 3 Structured Program Development in C Part II Chapter 3 Structured Program Development in C Part II C How to Program, 8/e, GE 2016 Pearson Education, Ltd. All rights reserved. 1 3.7 The while Iteration Statement An iteration statement (also called

More information

Basic Communication Operations (Chapter 4)

Basic Communication Operations (Chapter 4) Basic Communication Operations (Chapter 4) Vivek Sarkar Department of Computer Science Rice University vsarkar@cs.rice.edu COMP 422 Lecture 17 13 March 2008 Review of Midterm Exam Outline MPI Example Program:

More information

GPU Accelerating Speeded-Up Robust Features Timothy B. Terriberry, Lindley M. French, and John Helmsen

GPU Accelerating Speeded-Up Robust Features Timothy B. Terriberry, Lindley M. French, and John Helmsen GPU Accelerating Speeded-Up Robust Features Timothy B. Terriberry, Lindley M. French, and John Helmsen Overview of ArgonST Manufacturer of integrated sensor hardware and sensor analysis systems 2 RF, COMINT,

More information

Data parallel algorithms 1

Data parallel algorithms 1 Data parallel algorithms (Guy Steele): The data-parallel programming style is an approach to organizing programs suitable for execution on massively parallel computers. In this lecture, we will characterize

More information

COSC160: Data Structures Hashing Structures. Jeremy Bolton, PhD Assistant Teaching Professor

COSC160: Data Structures Hashing Structures. Jeremy Bolton, PhD Assistant Teaching Professor COSC160: Data Structures Hashing Structures Jeremy Bolton, PhD Assistant Teaching Professor Outline I. Hashing Structures I. Motivation and Review II. Hash Functions III. HashTables I. Implementations

More information

Maximizing Face Detection Performance

Maximizing Face Detection Performance Maximizing Face Detection Performance Paulius Micikevicius Developer Technology Engineer, NVIDIA GTC 2015 1 Outline Very brief review of cascaded-classifiers Parallelization choices Reducing the amount

More information

Lecture 11 Parallel Computation Patterns Reduction Trees

Lecture 11 Parallel Computation Patterns Reduction Trees ECE408 Applied Parallel Programming Lecture 11 Parallel Computation Patterns Reduction Trees 1 Objective To master Reduction Trees, arguably the most widely used parallel computation pattern Basic concept

More information

/INFOMOV/ Optimization & Vectorization. J. Bikker - Sep-Nov Lecture 10: GPGPU (3) Welcome!

/INFOMOV/ Optimization & Vectorization. J. Bikker - Sep-Nov Lecture 10: GPGPU (3) Welcome! /INFOMOV/ Optimization & Vectorization J. Bikker - Sep-Nov 2018 - Lecture 10: GPGPU (3) Welcome! Today s Agenda: Don t Trust the Template The Prefix Sum Parallel Sorting Stream Filtering Optimizing GPU

More information

Combinational Logic Circuits

Combinational Logic Circuits Combinational Logic Circuits By Dr. M. Hebaishy Digital Logic Design Ch- Rem.!) Types of Logic Circuits Combinational Logic Memoryless Outputs determined by current values of inputs Sequential Logic Has

More information

Data Structures and Algorithms

Data Structures and Algorithms Data Structures and Algorithms Spring 2017-2018 Outline 1 Priority Queues Outline Priority Queues 1 Priority Queues Jumping the Queue Priority Queues In normal queue, the mode of selection is first in,

More information

Introduction to Parallel Programming Part 4 Confronting Race Conditions

Introduction to Parallel Programming Part 4 Confronting Race Conditions Introduction to Parallel Programming Part 4 Confronting Race Conditions Intel Software College Objectives At the end of this module you should be able to: Give practical examples of ways that threads may

More information

Lecture 19 Sorting Goodrich, Tamassia

Lecture 19 Sorting Goodrich, Tamassia Lecture 19 Sorting 7 2 9 4 2 4 7 9 7 2 2 7 9 4 4 9 7 7 2 2 9 9 4 4 2004 Goodrich, Tamassia Outline Review 3 simple sorting algorithms: 1. selection Sort (in previous course) 2. insertion Sort (in previous

More information

Parallel Programming

Parallel Programming Parallel Programming Midterm Exam Wednesday, April 27, 2016 Your points are precious, don t let them go to waste! Your Time All points are not equal. Note that we do not think that all exercises have the

More information

Using the Deutsch-Jozsa algorithm to determine parts of an array and apply a specified function to each independent part

Using the Deutsch-Jozsa algorithm to determine parts of an array and apply a specified function to each independent part Using the Deutsch-Jozsa algorithm to determine parts of an array and apply a specified function to each independent part Samir Lipovaca slipovaca@nyse.com Keywords: Deutsch-Jozsa, algorithm, quantum computer,

More information

Synchronization. CSCI 3753 Operating Systems Spring 2005 Prof. Rick Han

Synchronization. CSCI 3753 Operating Systems Spring 2005 Prof. Rick Han Synchronization CSCI 3753 Operating Systems Spring 2005 Prof. Rick Han Announcements HW #3 is coming, due Friday Feb. 25, a week+ from now PA #2 is coming, assigned about next Tuesday Midterm is tentatively

More information

Last time. Today: Convex Hull Brute Force Inside(q,abc) Intersect(ab,cd) Orient(a,b,c).

Last time. Today: Convex Hull Brute Force Inside(q,abc) Intersect(ab,cd) Orient(a,b,c). Last time Convex Hull Brute Force Inside(q,abc) Intersect(ab,cd) Orient(a,b,c). Today: More efficient convex hull algorithms and absolute bounds. Two (of many) algorithms. One (of one) interesting reduction.

More information

Programming (1.0hour)

Programming (1.0hour) COMPETITOR S INSTRUCTION:- Attempt all questions: Where applicable circle the letter that indicates the correct answer. Otherwise answer questions as instructed D1.1 Embedded code is used widely in modern

More information

CSC Design and Analysis of Algorithms. Lecture 7. Transform and Conquer I Algorithm Design Technique. Transform and Conquer

CSC Design and Analysis of Algorithms. Lecture 7. Transform and Conquer I Algorithm Design Technique. Transform and Conquer CSC 83- Design and Analysis of Algorithms Lecture 7 Transform and Conuer I Algorithm Design Techniue Transform and Conuer This group of techniues solves a problem by a transformation to a simpler/more

More information

CSC Design and Analysis of Algorithms. Lecture 8. Transform and Conquer II Algorithm Design Technique. Transform and Conquer

CSC Design and Analysis of Algorithms. Lecture 8. Transform and Conquer II Algorithm Design Technique. Transform and Conquer CSC 301- Design and Analysis of Algorithms Lecture Transform and Conuer II Algorithm Design Techniue Transform and Conuer This group of techniues solves a problem by a transformation to a simpler/more

More information

Piccolo. Fast, Distributed Programs with Partitioned Tables. Presenter: Wu, Weiyi Yale University. Saturday, October 15,

Piccolo. Fast, Distributed Programs with Partitioned Tables. Presenter: Wu, Weiyi Yale University. Saturday, October 15, Piccolo Fast, Distributed Programs with Partitioned Tables 1 Presenter: Wu, Weiyi Yale University Outline Background Intuition Design Evaluation Future Work 2 Outline Background Intuition Design Evaluation

More information

Binary representation of integer numbers Operations on bits

Binary representation of integer numbers Operations on bits Outline Binary representation of integer numbers Operations on bits The Bitwise AND Operator The Bitwise Inclusive-OR Operator The Bitwise Exclusive-OR Operator The Ones Complement Operator The Left Shift

More information

Getting the Most out of your GPU. Imre Palik Introduction to Data-Parallel Algorithms. Imre Palik.

Getting the Most out of your GPU. Imre Palik Introduction to Data-Parallel Algorithms. Imre Palik. to Data- to Data- Getting the Most out of your GPU imre.palik@morganstanley.com Naive Segmented The views expressed in this presentation are those of the author and, therefore, do not necessarily reflect

More information

Parallel Programming in C with MPI and OpenMP

Parallel Programming in C with MPI and OpenMP Parallel Programming in C with MPI and OpenMP Michael J. Quinn Chapter 17 Shared-memory Programming 1 Outline n OpenMP n Shared-memory model n Parallel for loops n Declaring private variables n Critical

More information

COMP 322: Fundamentals of Parallel Programming. Lecture 13: Parallelism in Java Streams, Parallel Prefix Sums

COMP 322: Fundamentals of Parallel Programming. Lecture 13: Parallelism in Java Streams, Parallel Prefix Sums COMP 322: Fundamentals of Parallel Programming Lecture 13: Parallelism in Java Streams, Parallel Prefix Sums Instructors: Vivek Sarkar, Mack Joyner Department of Computer Science, Rice University {vsarkar,

More information

ENGR 3950U / CSCI 3020U UOIT, Fall 2012 Quiz on Process Synchronization SOLUTIONS

ENGR 3950U / CSCI 3020U UOIT, Fall 2012 Quiz on Process Synchronization SOLUTIONS Name: Student Number: SOLUTIONS ENGR 3950U / CSCI 3020U (Operating Systems) Quiz on Process Synchronization November 13, 2012, Duration: 40 Minutes (10 questions and 8 pages, 45 Marks) Instructor: Dr.

More information

CS Elementary Graph Algorithms & Transform-and-Conquer

CS Elementary Graph Algorithms & Transform-and-Conquer CS483-10 Elementary Graph Algorithms & Transform-and-Conquer Outline Instructor: Fei Li Room 443 ST II Office hours: Tue. & Thur. 1:30pm - 2:30pm or by appointments Depth-first Search cont Topological

More information

Merge Sort Goodrich, Tamassia Merge Sort 1

Merge Sort Goodrich, Tamassia Merge Sort 1 Merge Sort 7 2 9 4 2 4 7 9 7 2 2 7 9 4 4 9 7 7 2 2 9 9 4 4 2004 Goodrich, Tamassia Merge Sort 1 Review of Sorting Selection-sort: Search: search through remaining unsorted elements for min Remove: remove

More information

Parallel Programming. OpenMP Parallel programming for multiprocessors for loops

Parallel Programming. OpenMP Parallel programming for multiprocessors for loops Parallel Programming OpenMP Parallel programming for multiprocessors for loops OpenMP OpenMP An application programming interface (API) for parallel programming on multiprocessors Assumes shared memory

More information

Pace University. Fundamental Concepts of CS121 1

Pace University. Fundamental Concepts of CS121 1 Pace University Fundamental Concepts of CS121 1 Dr. Lixin Tao http://csis.pace.edu/~lixin Computer Science Department Pace University October 12, 2005 This document complements my tutorial Introduction

More information

Transactions and Concurrency Control

Transactions and Concurrency Control Transactions and Concurrency Control Transaction: a unit of program execution that accesses and possibly updates some data items. A transaction is a collection of operations that logically form a single

More information

16/10/2008. Today s menu. PRAM Algorithms. What do you program? What do you expect from a model? Basic ideas for the machine model

16/10/2008. Today s menu. PRAM Algorithms. What do you program? What do you expect from a model? Basic ideas for the machine model Today s menu 1. What do you program? Parallel complexity and algorithms PRAM Algorithms 2. The PRAM Model Definition Metrics and notations Brent s principle A few simple algorithms & concepts» Parallel

More information

CS 314 Principles of Programming Languages

CS 314 Principles of Programming Languages CS 314 Principles of Programming Languages Zheng Zhang Fall 2016 Dec 14 GPU Programming Rutgers University Programming with CUDA Compute Unified Device Architecture (CUDA) Mapping and managing computations

More information

CSE 332: Data Structures & Parallelism Lecture 15: Analysis of Fork-Join Parallel Programs. Ruth Anderson Autumn 2018

CSE 332: Data Structures & Parallelism Lecture 15: Analysis of Fork-Join Parallel Programs. Ruth Anderson Autumn 2018 CSE 332: Data Structures & Parallelism Lecture 15: Analysis of Fork-Join Parallel Programs Ruth Anderson Autumn 2018 Outline Done: How to use fork and join to write a parallel algorithm Why using divide-and-conquer

More information

CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012

CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012 CDA 3200 Digital Systems Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012 Outline Data Representation Binary Codes Why 6-3-1-1 and Excess-3? Basic Operations of Boolean Algebra Examples

More information

Assignment 2 (programming): Problem Description

Assignment 2 (programming): Problem Description CS2210b Data Structures and Algorithms Due: Monday, February 14th Assignment 2 (programming): Problem Description 1 Overview The purpose of this assignment is for students to practice on hashing techniques

More information

WRITING DATA PARALLEL ALGORITHMS ON GPUs

WRITING DATA PARALLEL ALGORITHMS ON GPUs WRITING DATA PARALLEL ALGORITHMS ON GPUs WITH C++ AMP Ade Miller Technical Director, CenturyLink Cloud. ABSTRACT TODAY MOST PCS, TABLETS AND PHONES SUPPORT MULTI-CORE PROCESSORS AND MOST PROGRAMMERS HAVE

More information

ECE 498AL. Lecture 12: Application Lessons. When the tires hit the road

ECE 498AL. Lecture 12: Application Lessons. When the tires hit the road ECE 498AL Lecture 12: Application Lessons When the tires hit the road 1 Objective Putting the CUDA performance knowledge to work Plausible strategies may or may not lead to performance enhancement Different

More information

Processor speed. Concurrency Structure and Interpretation of Computer Programs. Multiple processors. Processor speed. Mike Phillips <mpp>

Processor speed. Concurrency Structure and Interpretation of Computer Programs. Multiple processors. Processor speed. Mike Phillips <mpp> Processor speed 6.037 - Structure and Interpretation of Computer Programs Mike Phillips Massachusetts Institute of Technology http://en.wikipedia.org/wiki/file:transistor_count_and_moore%27s_law_-

More information

Database Applications (15-415)

Database Applications (15-415) Database Applications (15-415) DBMS Internals- Part VI Lecture 14, March 12, 2014 Mohammad Hammoud Today Last Session: DBMS Internals- Part V Hash-based indexes (Cont d) and External Sorting Today s Session:

More information

Presentation for use with the textbook, Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015

Presentation for use with the textbook, Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015 Presentation for use with the textbook, Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015 Quick-Sort 7 4 9 6 2 2 4 6 7 9 4 2 2 4 7 9 7 9 2 2 9 9 2015 Goodrich and Tamassia

More information

Sorting Goodrich, Tamassia Sorting 1

Sorting Goodrich, Tamassia Sorting 1 Sorting Put array A of n numbers in increasing order. A core algorithm with many applications. Simple algorithms are O(n 2 ). Optimal algorithms are O(n log n). We will see O(n) for restricted input in

More information

ECE 122. Engineering Problem Solving Using Java

ECE 122. Engineering Problem Solving Using Java ECE 122 Engineering Problem Solving Using Java Lecture 27 Linear and Binary Search Overview Problem: How can I efficiently locate data within a data structure Searching for data is a fundamental function

More information

EE382N (20): Computer Architecture - Parallelism and Locality Spring 2015 Lecture 13 Parallelism in Software I

EE382N (20): Computer Architecture - Parallelism and Locality Spring 2015 Lecture 13 Parallelism in Software I EE382N (20): Computer Architecture - Parallelism and Locality Spring 2015 Lecture 13 Parallelism in Software I Mattan Erez The University of Texas at Austin N EE382N: Parallelilsm and Locality, Spring

More information

DATA STRUCTURE : A MCQ QUESTION SET Code : RBMCQ0305

DATA STRUCTURE : A MCQ QUESTION SET Code : RBMCQ0305 Q.1 If h is any hashing function and is used to hash n keys in to a table of size m, where n

More information

Clocked Sequential System Design. Multiply Example

Clocked Sequential System Design. Multiply Example Clocked Sequential System Design Example 1 Multipliers (Gradeschool, Modified Gradeschool) Multiply Example (185) (215) 00000000 00000000 ------ 1001101101011111 (39775) 1 0000000000000000

More information

Digital Computer Arithmetic

Digital Computer Arithmetic Digital Computer Arithmetic Part 6 High-Speed Multiplication Soo-Ik Chae Spring 2010 Koren Chap.6.1 Speeding Up Multiplication Multiplication involves 2 basic operations generation of partial products

More information

CS584/684 Algorithm Analysis and Design Spring 2017 Week 3: Multithreaded Algorithms

CS584/684 Algorithm Analysis and Design Spring 2017 Week 3: Multithreaded Algorithms CS584/684 Algorithm Analysis and Design Spring 2017 Week 3: Multithreaded Algorithms Additional sources for this lecture include: 1. Umut Acar and Guy Blelloch, Algorithm Design: Parallel and Sequential

More information

Concurrency: a crash course

Concurrency: a crash course Chair of Software Engineering Carlo A. Furia, Marco Piccioni, Bertrand Meyer Concurrency: a crash course Concurrent computing Applications designed as a collection of computational units that may execute

More information

8. Binary Search Tree

8. Binary Search Tree 8 Binary Search Tree Searching Basic Search Sequential Search : Unordered Lists Binary Search : Ordered Lists Tree Search Binary Search Tree Balanced Search Trees (Skipped) Sequential Search int Seq-Search

More information

Introduction to Parallel Programming

Introduction to Parallel Programming Introduction to Parallel Programming Pablo Brubeck Department of Physics Tecnologico de Monterrey October 14, 2016 Student Chapter Tecnológico de Monterrey Tecnológico de Monterrey Student Chapter Outline

More information

Systems Programming/ C and UNIX

Systems Programming/ C and UNIX Systems Programming/ C and UNIX Alice E. Fischer November 22, 2013 Alice E. Fischer () Systems Programming Lecture 12... 1/27 November 22, 2013 1 / 27 Outline 1 Jobs and Job Control 2 Shared Memory Concepts

More information

Di Zhao Ohio State University MVAPICH User Group (MUG) Meeting, August , Columbus Ohio

Di Zhao Ohio State University MVAPICH User Group (MUG) Meeting, August , Columbus Ohio Di Zhao zhao.1029@osu.edu Ohio State University MVAPICH User Group (MUG) Meeting, August 26-27 2013, Columbus Ohio Nvidia Kepler K20X Intel Xeon Phi 7120 Launch Date November 2012 Q2 2013 Processor Per-processor

More information

Quick-Sort fi fi fi 7 9. Quick-Sort Goodrich, Tamassia

Quick-Sort fi fi fi 7 9. Quick-Sort Goodrich, Tamassia Quick-Sort 7 4 9 6 2 fi 2 4 6 7 9 4 2 fi 2 4 7 9 fi 7 9 2 fi 2 9 fi 9 Quick-Sort 1 Quick-Sort ( 10.2 text book) Quick-sort is a randomized sorting algorithm based on the divide-and-conquer paradigm: x

More information