MemoryIntermediate~90 min

GPU Image Processing Pipeline

Build a complete image processing pipeline: grayscale conversion → Gaussian blur → Sobel edge detection. Each stage is a separate CUDA kernel; chain them with CUDA streams and benchmark every step.

convolutionshared-memorycudaStreamsimagesobelgaussian

// TUTORIAL

GPU execution
1 / 2

Step 1 — RGB to Grayscale

A classic first GPU kernel: one thread per pixel, perfectly parallel with no data dependencies.

Luminance formula:
gray = 0.299f * R + 0.587f * G + 0.114f * B

These weights match human eye sensitivity (green appears brightest).

Task: Implement rgbToGray. Each thread computes its 2D pixel index from blockIdx and threadIdx, applies the formula, and writes to gray[].
main.cu
loading editor…

// expected output

Grayscale: 0.12 ms
Pixel[0] expected=87.81 got=87.81 OK

// YOUR PROGRESS

Log in to save progress

// DETAILS

Category
Memory
Difficulty
Intermediate
Est. time
~90 min
Prerequisites
1

// LEARN THE THEORY

Memory concepts