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