0Pricing
CUDA Academy · Lesson

cudaMalloc and cudaFree

Reserving and releasing global memory.

The GPU Has Its Own RAM

Your GPU does not borrow the computer's main memory. It owns a separate pool called global memory that kernels read and write. 🧠

You Must Ask for It

Before a kernel can use device memory, you reserve a chunk yourself. The function that does this reserving is cudaMalloc.

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