{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

assignment3

# assignment3 - CS 240A Assignment 3 Cilkified Inner Products...

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

CS 240A Assignment 3: Cilkified Inner Products Assigned April 18, 2011 Due by 11:59 pm Monday, April 25 The purpose of this assignment is to gain familiarity with Cilk++ constructs and tools, and to think about different ways of parallelizing an algorithm using Cilk++. You will write a parallel routine that computes the inner product (dot product) of two vectors in three different ways. Your goal is to compare, understand, and optimize the performance of this simple computation. As usual, you’ll do this in a group of two from different departments, and after it’s due you’ll swap submissions with another team to write a review. 1. Background The inner product of two vectors is the sum of their elementwise multiplications. In pure C, the inner product of two real n -vectors can be implemented as follows: double innerprod = 0; for(int i=0; i< n; ++i) { innerprod += a[i] * b[i]; } In C++, the standard library has a dedicated function for computing the inner product. It is made available by including the <numeric> header. For the purposes of this assignment (and this class), you don’t have to know and use C++, but you’re allowed to do so because the Cilk++ compiler is an extension of C++ and will accept all C++ constructs.

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.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern