CUDA存储器模型:
GPU片内:register,shared memory;
板载显存:local memory,constant memory, texture memory, texture memory,global memory;
host 内存: host memory, pinned memory.
register: 访问延迟极低;
基本单元:register file (32bit/each)
计算能力1.0/1.1版本硬件:8192/SM;
计算能力1.2/1.3版本硬件: 16384/SM;
每个线程占有的register有限,编程时不要为其分配过多私有变量;
local memory:寄存器被使用完毕,数据将被存储在局部存储器中;
大型结构体或者数组;

本文介绍了CUDA的存储器模型,包括GPU片内的register和shared memory,板载显存的local memory、constant memory、texture memory和global memory,以及host内存的host memory和pinned memory。CUDA编程中,register访问延迟低,shared memory用于线程间通信,global memory存在于显存中,host memory则分为pageable和pinned类型。pinned memory用于加速主机端与设备端的数据传输,并可通过cudaMalloc等API进行管理。此外,还讨论了constant memory和texture memory的特性及其在CUDA编程中的应用。
最低0.47元/天 解锁文章
129

被折叠的 条评论
为什么被折叠?



