__global__ void initBlob(const unsigned char *in, unsigned char *out, size_t *indexTab, int total2D) { size_t i = blockIdx.x * blockDim.x + threadIdx.x; if(i < total2D) { out[i] = in[i]; if(255 == in[i]) { indexTab[i] = i; printf("index[%d] = %d ",i, indexTab[i]); } } }
indexTab[i]的值老是为零。请问这是为什么啊