Programming Parallel Computers

Open 2024a

CP4: GPU baseline ★

You need to log in to make submissions.

What you will need to do in this task

Please read the general instructions for this exercise first. Here are the additional instructions specific to this task:

Implement a simple baseline solution for the GPU. Make sure it works correctly and that it is reasonably efficient. Make sure that all performance-critical parts are executed on the GPU; you can do some lightweight preprocessing and postprocessing also on the CPU. Remember to check all CUDA operations for errors. In this task, you are permitted to use single-precision floating point numbers.

What I will try to do with your code

I will first run all kinds of tests to see that your code works correctly. You can try it out locally by running ./grading test, but please note that your code has to compile and work correctly not only on your own computer but also on our machines.

If all is fine, I will run the benchmarks. You can try it out on your own computer by running ./grading benchmark, but of course the precise running time on your own computer might be different from the performance on our grading hardware.

Benchmarks

Name Parameters
benchmarks/1a nx = 1000, ny = 1000
the input contains 1000 × 1000 pixels, and the output should contain 1000 × 1000 pixels
benchmarks/1b nx = 999, ny = 999
the input contains 999 × 999 pixels, and the output should contain 999 × 999 pixels
benchmarks/1c nx = 1001, ny = 1001
the input contains 1001 × 1001 pixels, and the output should contain 1001 × 1001 pixels
benchmarks/2a nx = 1000, ny = 4000
the input contains 4000 × 1000 pixels, and the output should contain 4000 × 4000 pixels
benchmarks/2b nx = 1000, ny = 4000
the input contains 4000 × 1000 pixels, and the output should contain 4000 × 4000 pixels

Grading

In this task your submission will be graded using benchmarks/2b: the input contains 4000 × 1000 pixels, and the output should contain 4000 × 4000 pixels.

The point thresholds are as follows. If you submit your solution no later than on Wednesday, 06 March 2024, at 23:59:59 (Helsinki), your score will be:

Running timePoints
≤ 5.000 sec 1
≤ 3.000 sec 2
≤ 2.000 sec 3
≤ 1.000 sec 4
≤ 0.500 sec 5

If you submit your solution after the deadline, but before the course ends on Wednesday, 03 April 2024, at 23:59:59 (Helsinki), your score will be:

Running timePoints
≤ 3.000 sec 1
≤ 2.000 sec 2
≤ 0.500 sec 3