This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Programming for Performance: Assignment 4 (v2) * Patrick Lam Due: April 4, 2011 This is an individual assignment. In this assignment, you will write OpenCL code to implement parts of an N-body simulation. The first part consists of converting some sequential C code into OpenCL, while the second part requires you to improve the algorithm by making approximations for points that are far away. Well be starting with the code from GPU Gems 3 1 . I also found an OpenCL N-body simulation code on the Internet 2 . I will also upload instructions on how to use the ece459-N computers to develop and test your code in the a4notes document. You are also free to use OpenCL on your own computer, if you choose. The sample code is at http://patricklam.ca/p4p/files/nbody-seq.c . Ill also make a git repository available if I need to make any changes. Submit your .c file containing the OpenCL version of the N-body code. Part 1: Brute-force approach (50 points) The easiest way to do an N-body simulation is to compute the effects of all points on each other. Ive posted some sequential code (based on the GPU Gems code) to calculate the forces for one time-step. Your first task is to convert this code to OpenCL. We will evaluate the correctness and efficiency of your conversion.to OpenCL....
View Full Document
- Spring '11