Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

CodeSignal

2D Grids and Matrix Math

via CodeSignal

Overview

Master 2D thread indexing in CUDA by mapping multidimensional grids to linear memory. You will implement row-major indexing, build a naive matrix multiplication kernel, and apply 2D grid-stride loops. These skills allow you to process large, rectangular datasets efficiently while ensuring your kernels remain scalable and flexible across various GPU architectures.

Syllabus

  • Unit 1: Mapping Matrix Coordinates
    • Mapping Matrix Coordinates
    • Find the Hidden Index Bug
    • Safe Matrix Threads
    • Covering the Whole Matrix
    • Patterned Matrix Values
  • Unit 2: Naive Matrix Multiplication
    • Building Matrix Products
    • Debugging Matrix Multiplication
    • Safe Threads for Matrix Multiply
    • Shaping the Launch Grid
    • Matching Matrix Dimensions
  • Unit 3: 2D Grid Stride Loops
    • Mastering Matrix Strides
    • Debugging Matrix Stride Loops
    • Finishing Matrix Addition
    • Scaling Matrix Work
    • Hunting Matrix Stride Bugs

Reviews

Start your review of 2D Grids and Matrix Math

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.