0Pricing
CUDA Academy · Lesson

Wiring Up the Host Side

Alloc, copy, launch, copy back, free.

The Host Has a Job Too

The kernel does the math, but the host CPU sets everything up. Its job is allocate, copy in, launch, copy back, and free. 🧩

Two Sets of Pointers

You keep host pointers for CPU arrays and separate device pointers for GPU buffers. A common habit is naming them h_A and d_A.

float *h_A, *h_B, *h_C;
float *d_A, *d_B, *d_C;

All lessons in this course

  1. The Vector Add Kernel
  2. Wiring Up the Host Side
  3. Verifying the Result on the CPU
  4. Timing Your First Speedup
← Back to CUDA Academy