Education and Outreach Blog

« Back

HPC UNIVERSITY BI-WEEKLY CHALLENGE – CUDA Fire

SUMMARY:


Your challenge is to parallelize part of an existing serial/OpenMP code simulating a forest fire to make use of the CUDA platform for running in parallel on a GPGPU.

QUESTION:


You are given as starter code the "CUDA Fire starter zip file" below. This code is for the simulation of a forest fire - the trees are arranged in a 2D grid; one random tree is initially lit on fire.

The code already makes use of OpenMP, but this is a red herring. Your challenge is to utilize CUDA to parallelize the advanceBurningTrees function so it can be run on a GPGPU. You should change this function to be a CUDA device kernel, and use cudaMemcpy to copy the relevant forest arrays back and forth from the GPGPU.

You should use the macro FOREST_ROW_COUNT as the block size when you run the kernel.

Don't forget to cudaMalloc and cudaFree your device memory!

If a solution is run on a host machine with a GPGPU, the advanceBurningTrees kernel should verifiably run on the GPGPU, but the output should be the same as the serial version (taking the programmed randomness into account).

SOLUTION:


Will be posted May 4, 2015

LINK:

http://hpcuniversity.org/students/weeklyChallenge/97

Comments
Trackback URL:

No comments yet. Be the first.