且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

CUDA全球内存,在哪里?

更新时间:2023-02-17 14:56:59

全局内存是一个虚拟地址空间,可以映射到设备内存或页锁定(固定)主机存储器。后者需要CC> 1.0。



本地,常量,纹理和本地内存分配在全局内存中,但通过不同的地址空间和缓存访问。



在CC> 2.0时,通用地址空间允许将共享内存映射到全局地址空间;然而,共享内存总是驻留在每个SM片上存储器中。


I understand that in CUDA's memory hierachy, we have things like shared memory, texture memory, constant memory, registers and of course the global memory which we allocate using cudaMalloc().

I've been searching through whatever documentations I can find but I have yet to come across any that explicitly explains what is the global memory.

I believe that the global memory allocated is on the GDDR of graphics card itself and not the RAM that is shared with the CPU since one of the documentations did state that the pointer cannot be dereferenced by the host side. Am I right?

Global memory is a virtual address space that can be mapped to device memory (memory on the graphics card) or page-locked (pinned) host memory. The latter requires CC > 1.0.

Local, constant, texture, and local memory are allocated in global memory but accessed through different address spaces and caches.

On CC > 2.0 the generic address space allows mapping of shared memory into the global address space; however, shared memory always resides in per SM on-chip memory.