关于GPU一些疑问
__global__ static void ThreadDemo1(unsigned int* ret)
{
unsigned int xIndex = blockDim.x * blockIdx.x + threadIdx.x;
unsigned int yIndex = blockDim.y * blockIdx.y + threadIdx.y;
if(xIndex < size_x && yIndex < size_y)
{
unsigned int index = xIndex + size_x * yIndex;
ret[index] = xIndex;
ret[index + size_x*size_y] = yIndex;
}
}
上面xIndex和yIndex他们具体是怎么来的,我现在开始学始终弄不明白block和threa是怎么工作的,谢谢各位了