caffe/util/device_alternate.hpp:
// CUDA: grid stride looping
#define CUDA_KERNEL_LOOP(i, n) \
for (int i = blockIdx.x * blockDim.x + threadIdx.x; \
i < (n); \
i += blockDim.x * gridDim.x)
I do not know when and where blockIdx.x, blockDim.x and threadIdx.x are defined and assigned. Anyone can give some advises? thank you very much~