Starting from:
$35

$29

Homework 5 (CUDA Programming) Solution

The objective of this programming assignment is to get you familiar with CUDA programming.




Specifically, you will need to write a CUDA program for Conway’s Game of Life problem:




The introduction of this problem is on https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life. In this assignment, the input data should be one matrix with size N * N and each element is 1 or 0. If the element is 1, it means the cell is live, while if the element is 0, it means the cell is dead. The life is evolving iteratively. In every iteration, the alive state of every cell is evaluated according to following rules:




 
Any live cell with fewer than two live neighbors dies, as if caused by under-population.




 
Any live cell with two or three live neighbors lives on to the next generation.

 
Any live cell with more than three live neighbors dies, as if by overcrowding.




 
Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction.




You should write a CUDA program to compute the alive state of all cells after specific iterations on Comet@SDSC.

 
Your program should print out (either to the standard output or to a file) the alive state of first 10 row * 10 column cells (100 cells) after 10, 100, 1000 iterations.

 
Your program should print timing statistics. In particular, you should print out the elapsed time taken to compute the alive state of cells, i.e., do not include the time taken to print out the results (or at least account for it separately).




Submission:




 
You should put your source code (.cu file) and documents into a .zip or .tar file, and upload it on the Blackboard. The name of .zip or .tar should follow the format: CS546_LastName_FirstName_HW5.




 
The document should include a design report (in PDF) explaining what algorithm you have implemented to compute the alive state of cells and any relevant implementation details. Your program should also describe how you guarantee the code correctness.

 
A README file is required to explain how to compile and run your programs, executables compiled on comed@sdsc.

 
You should also include a result report (in PDF) to list the runtimes for different matrix size and attach the printing out data for each matrix size. Evaluate the performance of your implementation. Here you need compare CUDA programming with serial code, which you also should provide and explain when you need CUDA.




Note on cheating: This is an individual assignment. Copying problem solutions or code is cheating. Both the person copying and the person giving the answers will be equally penalized. Make sure you do your own work.










1

More products