Assignment 1 - CUDA and Bender Setup

DUE Monday, October 16 @ 11:59:59PM Pacific Time


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: BenderTutorial.pdf

If you are unfamiliar with using the Linux commandline, there's a great tutorial here:

  1. For this lab, we will be using Github Classroom.
    Please join the classroom by clicking the following link:
    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.

Matrix Addition

Once you have access to Bender and confirmed it can compile and run CUDA code, we will implement a simple Vector Multiply.

  1. Clone the git repository. There should be 5 files:,, Makefile,, support.h
  2. By default, Matrix Addition operates on 1000x1000 matrices, which are randomly generated. To ensure consistency when grading, do not add any srad seed value in
  3. Complete the Matrix Addition application by adding your code to and Use a thread block dimension of 16x16. You may consult the class slides on vector add.

Answer the following questions:

  1. How many total thread blocks do we use?
  1. Are all thread blocks full? That is, do all threads in the thread block have data to operate on?
  1. How can this basic Matrix Addition program be improved? (What changes do you think can be made to speed up the code?)


  1. Answer the previous questions by including a report document in the repository in either PDF, Plain text, or Markdown format only. Please name your report FirstName-LastName.pdf or FirstName-LastName.txt or, etc.
  2. Commit and push your completed Matrix Addition to the github repository. (You only need to modify and

    Please also include your name in the report.