Assignment 1 - CUDA and Bender Setup
DUE Friday, April 24 at midnight
Overview
The objective of this assignment is to get setup with using CUDA on the Bender ENGR server.
The following tutorial provides detail steps and directions (Thanks Mohammadreza Rezvani!):
BenderTutorial.pdf
If you are unfamiliar with using the Linux commandline, there's a great tutorial here: https://www.codecademy.com/learn/learn-the-command-line
- For this lab, we will be using Github Classroom.
Please join the classroom by clicking the following link:
https://classroom.github.com/a/eO6Nhnjz
Once you join the classroom, a private github repository will automatically be created with the starter code.
Simply git clone
to copy the starter code to Bender.
Vector Add
Once you have access to Bender and confirmed it can compile and run CUDA code, we will implement a simple Vector Add.
- Clone the git repository. There should be 5 files:
kernel.cu
, main.cu
, Makefile
, support.cu
, support.h
- By default, vector add operates on 1000 elements, which care randomly generated. To ensure consistency when grading, do not change the srad seed value.
- Complete the vector add application by adding your code to
main.cu
and kernel.cu
. Use a thread block size of 256. You may consult the class slides on vector add.
Answer the following questions:
- How many total thread blocks do we use?
- Are all thread blocks full? That is, do all threads in the thread block have data to operate on?
- How can this basic vector add program be improved? (What changes do you think can be made to speed up the code?)
Submission
- Commit and push your completed Vector Add to the github repository. (You only need to modify
kernel.cu
and main.cu
.)
- Answer the previous questions by including a report document in the repository. Please name your report
report.pdf
or report.txt
or report.docx
, etc.
Please include your name in the report.