0PricingLogin
CUDA Academy · Lesson

Pointers to GPU Memory

Device pointers live in host variables.

A Pointer That Lives on the CPU

cudaMalloc hands you a normal C++ pointer variable. It sits in host memory, but the address inside it points into GPU memory. 🔗

The Address Means the Device

A device pointer holds a number that is only valid in the GPU's address space. To the CPU it is just an integer, not real RAM.

float* d_data;  // host variable, device address

All lessons in this course

  1. cudaMalloc and cudaFree
  2. Pointers to GPU Memory
  3. cudaMemset for Initialization
  4. Avoiding Leaks and Double-Frees
← Back to CUDA Academy