Ask Computer Engineering Expert

The purpose of this programming assignment is to familiarize yourself with some of the features of the CUDA programming environment and C language extensions that were presented in class, through a small parallel programming assignment. You may use grendel.csep.umflint.edu or other machines (having CUDA devices) that you may have access to. However, the program will be tested on grendel. You may upload the completed program on my web site, or you can simply leave it on grendel for it to be checked.
General Requirements

The specific program is actually two programs: first, a sequential version that only runs on the CPU; second, a GPU version that does as much as possible in parallel using one or more CUDA kernels or device functions. This is mainly done for comparison's sake, although you should also be able to use the CPU-only version in developing the GPU version. Insert timing functions to determine the amount of (non-file-read) time taken by each version of the program.

The function of either program is to compute some statistics on a large data set (as with program 6), which is to be read from a file. Data files for testing are provided in a zip or tar.gz file (linked in with program 6 on the programs page and also available to directly copy on grendel). The programs must compute the following values: mean, maximum, minimum, variance, and standard deviation, which should be printed out at the end of your program run. Note that the operations involved in calculating these all require at least one reduction, and the variance also requires some parallel computations suitable for a GPU.
Specific Requirements

Specific program requirements are as follows (in no particular order of importance):

Your program will accept one command-line argument specifying the name of the input file.

Your program will output the statistics, one per line, with suitable labels. For ex:

Maximum: 43,221.2
Minimum: 0.5
Mean: 1234.5
Variance: 4
Std Dev: 2



Use a "modest" number of threads and blocks so that for large data sets, there should be many more data elements than total threads. The grid dimension and block size can/should be one-dimensional. The point is that when computing something (e.g. the differences from mean for each value while computing variance), each thread should iterate through multiple data points.

There will be up to 10 extra points awarded if you develop and use a reduction operation on the data set when computing certain values, such as maximum, minimum, mean, etc. Depending on the computation involved, it may require several reduction-type of operations. (e.g. variance). Some of these should (obviously?) be easier than others; for ex, maximum and minimum are pretty much one single reduction operation each. Note that there are resources (including from NVidia) on how to program reductions in CUDA.

Use __syncthreads() where appropriate.

It should go without saying that standard deviation, being the square root of variance, isn't really a parallel operation. It's really just there for completeness.

Don't assume that the the number of elements in a data set is a precise power of 2. In fact, assume it's not.

Other Requirements

Submit a typed one-page summary of comparisons of timing of the two programs for the same input sets.

Name your main program prog07.cu. You can leave it in your home directory, where I will examine it. Otherwise, you can upload a copy of the program in a zip file, if you wish.

In your comment block to begin your main program, other than the function of the program and the variable dictionary, include a set of comments of the following format. It is very important for you to include your name, the compiler you used, the due date, and the program identity:

// Name: Joe M. Student
// Program: CSC 478/578 Program 7
// Due Date: 04/28/14

Your program should follow "reasonable" rules of style, with appropriate indentation and commenting.
Other Notes

As mentioned above, data files are linked on the page along with this assignment.

Look on the code exs page for CUDA exs related to the lectures, as well as ex code showing how to do timing on linux and gather command-line arguments.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M981102

Have any Question?


Related Questions in Computer Engineering

Does bmw have a guided missile corporate culture and

Does BMW have a guided missile corporate culture, and incubator corporate culture, a family corporate culture, or an Eiffel tower corporate culture?

Rebecca borrows 10000 at 18 compounded annually she pays

Rebecca borrows $10,000 at 18% compounded annually. She pays off the loan over a 5-year period with annual payments, starting at year 1. Each successive payment is $700 greater than the previous payment. (a) How much was ...

Jeff decides to start saving some money from this upcoming

Jeff decides to start saving some money from this upcoming month onwards. He decides to save only $500 at first, but each month he will increase the amount invested by $100. He will do it for 60 months (including the fir ...

Suppose you make 30 annual investments in a fund that pays

Suppose you make 30 annual investments in a fund that pays 6% compounded annually. If your first deposit is $7,500 and each successive deposit is 6% greater than the preceding deposit, how much will be in the fund immedi ...

Question -under what circumstances is it ethical if ever to

Question :- Under what circumstances is it ethical, if ever, to use consumer information in marketing research? Explain why you consider it ethical or unethical.

What are the differences between four types of economics

What are the differences between four types of economics evaluations and their differences with other two (budget impact analysis (BIA) and cost of illness (COI) studies)?

What type of economic system does norway have explain some

What type of economic system does Norway have? Explain some of the benefits of this system to the country and some of the drawbacks,

Among the who imf and wto which of these governmental

Among the WHO, IMF, and WTO, which of these governmental institutions do you feel has most profoundly shaped healthcare outcomes in low-income countries and why? Please support your reasons with examples and research/doc ...

A real estate developer will build two different types of

A real estate developer will build two different types of apartments in a residential area: one- bedroom apartments and two-bedroom apartments. In addition, the developer will build either a swimming pool or a tennis cou ...

Question what some of the reasons that evolutionary models

Question : What some of the reasons that evolutionary models are considered by many to be the best approach to software development. The response must be typed, single spaced, must be in times new roman font (size 12) an ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As