准备系统学习cuda知识。
这一章基本都懂,记录一下一些细节:
global 表示函数在device上 后面永远是void
device function is asynchromous. cudaDeviceSynchronize() waits the device code finish
用自带的变量类型可以自动实现alignment,如果自定义结构体需要手工操作:
struct __align__(16) {
float a, b, c;
}
记录查询到的我笔记本的GPU参数,方便编程:
gtx 1060 架构是 61
2 GPC (Graphics Processing Clusters)
Each GPU houses five SM (Streaming Multiprocessor) units
Each SM consists of 128 CUDA cores, 8 TMUs(Texture Mapping Units)
Each SM consists of 256 KB of register file capacity, a 96 KB shared memory unit and 48 KB of total L1 cache storage.