hw04 - LSU EE 7700-1 Homework 4 Due: 28 April 2010 To...

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

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: LSU EE 7700-1 Homework 4 Due: 28 April 2010 To complete this assignment follow the setup instructions from the course Web page (if not already followed). The setup instructions bring you to the point where you can compile the cpu-only examples but for this assignment that wont be necessary. Then follow the instructions in the first problem to complete and test the setup. Problem 0: Check out the latest copy of the balls project base code and the include directory. The transcript below shows the steps needed. ( a ) Read the following overview of how the code operates. This code includes something like a solution to Homework 3, except that direct cuda calls were not made and the code returns the actual proximity pairs, not just a count. The code computing proximity pairs runs inefficiently due to data access problems and other issues, the point of this homework assignment is to improve it. Here is an outline of how the affected code operates: The code in balls.cc:cuda_contact_pairs_find sorts the balls (phys) in z order using class PSList. An array on cuda, z_sort_indices , maps a z-order index to a balls array in- dex. For example, z_sort_index[5] == 12 means that ball number 12 (the index to cpu ar- ray physs and gpu arrays ball_x ) has the sixth smallest z value. This array is initialized in balls.cc:cuda_contact_pairs_find and sent over to CUDA. The z max values are also placed in an array and sent to CUDA. The routine launches a CUDA kernel, pass_sched , to compute the proximity pairs, and reads back this data, in CUDA array cuda_prox . The data in cuda_prox is unpacked in routine con- tact_pairs_find . The problems below are related to the data moving between CPU and GPU, and data moving between the different memory areas in the GPU. Here is a summary of data movement that the proximity code currently induces: The kernel pass_sched reads the z_sort_indices and z max arrays, and also reads the data in balls_x that is already present on the GPU. (That is, the data for balls_x is only sent to the GPU when balls are added or removed. Otherwise the GPU keeps using the copy it has.) The kernel writes only the array cuda_prox ....
View Full Document

Page1 / 4

hw04 - LSU EE 7700-1 Homework 4 Due: 28 April 2010 To...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online