HPC Project 10: An OpenCL Project


This week's project is to compare CUDA and OpenCL. To do so, you will need to create vectorHypot.cl, an OpenCL version of the hypotenuse calculation we did last week in CUDA.

Part V: Homework

Your task is to write vectorHypot.cl that computes C[i] = sqrt( A[i]*A[i] + B[i]*B[i] ) for all the elements in arrays A, B, and C. Your program should compute this sequentially and using OpenCL, time both computations, and verify the correctness of the computations, as we did in last week's project.

As before, create a line chart that compares your sequential and OpenCL computations for arrays of size 50,000; 500,000; 5,000,000; and 50,000,000; and a stacked bar chart showing the times spent in the different portions of the OpenCL computation.

Using your spreadsheet from last week, create a line chart that compares the runtimes of vectorHypot.cu and vectorHypot.cl for each of four array sizes.

This is a one week project.

Hand In

Please staple or paperclip your pages together.

CS > 374 > Exercises > 10 > Homework Project

This page maintained by Joel Adams.