Skip to content

lancerts/lecture

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Supplementary Material for Lectures

The PMPP Book: Programming Massively Parallel Processors: A Hands-on Approach (Amazon link)

Lecture 1: Profiling and Integrating CUDA kernels in PyTorch

Lecture 2: Recap Ch. 1-3 from the PMPP book

  • Video
  • Date: 2024-01-20, Speaker: Andreas Koepf
  • Slides: The powerpoint file lecture2/cuda_mode_lecture2.pptx can be found in the root directory of this repository. Alternatively here as Google docs presentation.
  • Examples: Please make sure PyTorch (2.1.2) and cuda-toolkit (nvcc compiler) are installed.
    • lecture2/vector_addition: Classic CUDA C example, to compile use make in the vector_addition directory.
    • lecture2/rgb_to_grayscale: Example uses PyTorch's torch.utils.cpp_extension.load_inline feature to compile a custom RGB to grayscale kernel and uses it to convert input image to grayscale and which is saved in as output.png. Run in the lecture2/rgb_to_grayscale folder python rgb_to_grayscale.py.
    • lecture2/mean_filter: This example also uses the PyTorch's cpp_extension.load_inline feature to compile a mean filter kernel. The kernel read pixel values in the surrounding (square area) of a pixel and computes the average value for each RGB channel individualy. The result is saved to output.png. Run in the lecture2/mean_filter folder python mean_filter.py.

Lecture 3: Getting Started With CUDA

Lecture 4: Intro to Compute and Memory Architecture

Lecture 5: Going Further with CUDA for Python Programmers

About

lecture-cuda

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 96.4%
  • Python 2.5%
  • Other 1.1%