// unique block index inside a 3D block grid
const unsigned long long int blockId = blockIdx.x //1D
+ blockIdx.y * gridDim.x //2D
+ gridDim.x * gridDim.y * blockIdx.z; //3D
// global unique thread index, block dimension uses only x-coordinate
const unsigned long long int threadId = blockId * blockDim.x + threadIdx.x;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7861 次 |
| 最近记录: |