cudaMalloc | RookieHPC
https://www.rookiehpc.com/cuda/docs/cudamalloc.phpcudaMalloc is a function that can be called from the host or the device to allocate memory on the device, much like malloc for the host. The memory allocated with cudaMalloc must be freed with cudaFree.Other variants of cudaMalloc are cudaMallocPitch, cudaMallocArray, cudaMalloc3D, cudaMalloc3DArray, cudaMallocHost and cuMemAlloc.