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
- cudaMalloc and cudaFree
- Pointers to GPU Memory
- cudaMemset for Initialization
- Avoiding Leaks and Double-Frees