avoid dangerous state in pooling layer CUDA kernels
avoid dangerous state in pooling layer CUDA kernels

Previously, pointers were modified with the assumption that they would
only be modified once. While this is true so far in practice, the
introduction of CUDA_KERNEL_LOOP makes this a dangerous assumption.

CZCV/s-dilation-caffe,tackgeun/caffe,wangg12/caffe,gnina/gnina,gnina/gnina,gogartom/caffe-textmaps,gogartom/caffe-textmaps,gnina/gnina,tackgeun/caffe,CZCV/s-dilation-caffe,gnina/gnina,longjon/caffe,gnina/gnina,gnina/gnina,longjon/caffe,wangg12/caffe,CZCV/s-dilation-caffe,wangg12/caffe,tackgeun/caffe,wangg12/caffe,tackgeun/caffe,longjon/caffe,gogartom/caffe-textmaps,longjon/caffe,CZCV/s-dilation-caffe,gogartom/caffe-textmaps