To maximize performance, CUDA uses different types of memory, depending on the expected usage. Host memory refers to the memory attached to the CPU(s) in the system. CUDA provides APIs that enable faster access to host memory by page-locking and mapping it for the GPU(s). Device memory is attached to the GPU and accessed by a dedicated memory controller, and, as every beginning CUDA developer knows, data must be copied explicitly between host and device memory in order to be processed by the GPU.
Device memory can be allocated and accessed in a variety of ways.
• Global memory may be allocated statically or dynamically and accessed via pointers in CUDA kernels, which translate to global load/store instructions.
• Constant memory ...