Link to this document's Jupyter Notebook

In order to successfully complete this assignment you must do the required reading, watch the provided videos and complete all instructions. The embedded survey form must be entirely filled out and submitted on or before 11:59pm on Sunday March 14. Students must come to class the next day prepared to discuss the material covered in this assignment.


Pre-Class Assignment: CUDA Alternatives

Goals for today's pre-class assignment

This pre-class assignment will review a few of the more common alternatives to CUDA.

  1. OpenCL (Open Computing Language))
  2. OpenACC (Open Accelerators))
  3. Kokkos and RAJA
  4. GPU Accelerated Libraries
  5. Assignment wrap up

1. OpenCL (Open Computing Language)

OpenCL is an alternative to CUDA which is designed to be more open and available on many different platforms. Watch the following video to get some history behind OpenCL.

OpenCL VectorAdd Example

DO THIS: Copy the following code to the HPC and compile/run using the commands provided below.

Example From: https://gist.github.com/ddemidov/2925717

QUESTION: Where you able to get the OpenCL code to compile and run?

Put your answer to the above question here.

QUESTION: If not, what problems did you encounter?

Put your answer to the above question here.


2. OpenACC (Open Accelerators)

The next programming extension is called OpenACC and tries to combine the ease of programming in OpenMP with the power of the GPU. It uses pragmas similar to OpenMP to compile and run code on the GPU.

DO THIS: Copy the following code to the HPC and compile/run using the commands provided below.

Example From: https://www.olcf.ornl.gov/tutorials/openacc-vector-addition/

QUESTION: Where you able to get the OpenACC code to compile and run?

Put your answer to the above question here.

QUESTION: If not, what problems did you encounter?

Put your answer to the above question here.


3. Kokkos and RAJA

Two newcomers to the playing field are Kokkos and RAJA. Neither are new languages but instead a C++ library intended to make it easier to run both OpenMP and GPU code. The goal of both programs is to:

  1. Enable application portability with manageable disruption to algorithms and programming styles.
  2. Achieve performance comparable to using various programming models (e.g., OpenMP, CUDA, etc.) directly

These two goals are very difficult. However, both projects seem to be getting close. It will be interesting to see which one "wins".

QUESTION: Why you think there are so many alternatives to CUDA (provide at least two reasons)?

Put your answer to the above question here


4. GPU Accelerated Libraries

Another way to avoid having to write your own CUDA code is to use CUDA Accelerated libraries. As a programmer you don't need to do anything except include the libraries and call the CUDA enabled functions.

DO THIS: Using your favorite search engine, find some common CUDA enabled libraries for Fast Fourier Transforms, Dense Linear Algebra and Sparse Linear Algebra

Put your answer to the above question here.

DO THIS: See if you can find other CUDA enabled libraries that you think could be useful. Come to class prepared to share what you found.

Put your answer to the above question here.


5. Assignment wrap up

Please fill out the form that appears when you run the code below. You must completely fill this out in order to receive credits for the assignment!

Direct Link to Google Form

If you have trouble with the embedded form, please make sure you log on with your MSU google account at googleapps.msu.edu and then click on the direct link above.

Assignment-Specific QUESTION: Why you think there are so many alternatives to CUDA (provide at least two reasons)?

Put your answer to the above question here

QUESTION: Summarize what you did in this assignment.

Put your answer to the above question here

QUESTION: What questions do you have, if any, about any of the topics discussed in this assignment after working through the jupyter notebook?

Put your answer to the above question here

QUESTION: How well do you feel this assignment helped you to achieve a better understanding of the above mentioned topic(s)?

Put your answer to the above question here

QUESTION: What was the most challenging part of this assignment for you?

Put your answer to the above question here

QUESTION: What was the least challenging part of this assignment for you?

Put your answer to the above question here

QUESTION: What kind of additional questions or support, if any, do you feel you need to have a better understanding of the content in this assignment?

Put your answer to the above question here

QUESTION: Do you have any further questions or comments about this material, or anything else that's going on in class?

Put your answer to the above question here

QUESTION: Approximately how long did this pre-class assignment take?

Put your answer to the above question here


Congratulations, we're done!

To get credit for this assignment you must fill out and submit the above survey from on or before the assignment due date.

Course Resources:

Written by Dr. Dirk Colbry, Michigan State University Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.