Thread execution
Execution model
Warp
Warp Divergence
减少branch结构
为什么是2是保证了if和else的情况
减少判断的次数,unroll
Memory hierarchy
local variable不一定非常快哦!
Register&Local memory
一个block中thread越多,则local variable会被挤出到global memory,高了反而不好,local variable只能是static,不能是dynamic的操作
L1速度与share memory速度差不多
第一次access time会花很多
Shared memory
比较旧的api可以设置对应的分开
每个thread搬动一部分数据
动态分配share memory
input和output对应数据
一个share memory只能有一个single share variable。
如果想多元表示,只能将一个去划分
Global & Constant memory
将constant variable cache到 register