CS3210 Parallel computing

Home

❯

Tutorials

❯

GPU and distributed computing

❯

Tutorial 5: GPU programming with CUDA

Tutorial 5: GPU programming with CUDA

CS3210 Site Preview Version
Unpublished Page

Have feedback?Share it anonymously↗

Graph View

  • Tutorial code
  • Learning outcomes
  • Exercise questions
  • Question 1
  • GPU parallel programming in CUDA
  • Part 1: familiarization with SoC Slurm and GPU nodes
  • Exercise 1
  • Exercise 2
  • Exercise 3
  • Exercise 4
  • Part 2: hello world in CUDA
  • What is a CUDA program?
  • CPU vs GPU code
  • Function execution space specifiers
  • Organizing threads in CUDA
  • Invoking a CUDA kernel function
  • Compiling and executing
  • Exercise 5
  • Determining the thread’s location in grid/block
  • Exercise 6
  • Executing CUDA threads – hardware’s perspective
  • Exercise 7
  • Exercise 8
  • Part 3: CUDA memory model
  • CUDA memory model
  • Global memory – static & dynamically allocated
  • Exercise 9
  • Exercise 10
  • Unified memory
  • Exercise 11
  • Shared memory
  • Exercise 12
  • Part 4: synchronization in CUDA
  • Atomic memory accesses
  • Exercise 13
  • Synchronization constructs
  • Exercise 14
  • Bringing it all together
  • Exercise 15

Backlinks

  • Assignment 2: Virus signature scanning with CUDA (AY2025/26 S2)
  • Assignment 2: Path tracing
  • Threads, warps and memory

CS3210 · AY2026/27 Semester 2

Built with Quartz