make the kernel mul function more safer. Refer to http://devblogs.nvidia.com/parallelforall/cuda-pro-tip-write-flexible-kernels-grid-stride-loops/
add kernel guard macro 

When we use CUDA, we could rewrite codes like:

int i = blockIdx.x * blockDim.x + threadIdx.x;
if (i < n) {
   // do something to array[i] 
}

to:

CUDA_KERNEL_GUARD(i, n) {
    // do something to array[i]
}

If we disable CUDA, and reuse the codes, we could just define CUDA_KERNEL_GUARD to 

for (int i = 0; i < n; ++i)

Then the CUDA codes could easily transfer to CPU.
add CUDA_KERNEL_GUARD macro
Merge branch 'master' of github.com:blackball/caffe
add space between ) and {