常看到内建变量会这样使用 int tid = threadIdx.x ; 然后程序就用tid做事。 这样会用掉registers吗? 还是不会用掉registers会用原本的变量取代? 效能我是没测,先问问。
编译器其实会优化,差不多