fix kernel loop bugs, compiles and passes all tests
authorJeff Donahue <jeff.donahue@gmail.com>
Wed, 19 Mar 2014 00:06:51 +0000 (17:06 -0700)
committerJeff Donahue <jeff.donahue@gmail.com>
Wed, 19 Mar 2014 00:07:52 +0000 (17:07 -0700)
src/caffe/layers/bnll_layer.cu
src/caffe/layers/pooling_layer.cu

index 76a1f2a..1fd2008 100644 (file)
@@ -36,7 +36,7 @@ void BNLLLayer<Dtype>::Forward_gpu(const vector<Blob<Dtype>*>& bottom,
 template <typename Dtype>
 __global__ void BNLLBackward(const int n, const Dtype* in_diff,
     const Dtype* in_data, Dtype* out_diff) {
-  CUDA_KERNEL_LOOP(index < n) {
+  CUDA_KERNEL_LOOP(index, n) {
     Dtype expval = exp(min(in_data[index], Dtype(kBNLL_THRESHOLD)));
     out_diff[index] = in_diff[index] * expval / (expval + 1.);
   }
index 14bae08..8735dde 100644 (file)
@@ -70,7 +70,7 @@ __global__ void StoPoolForwardTrain(const int nthreads,
     const int num, const int channels, const int height,
     const int width, const int pooled_height, const int pooled_width,
     const int ksize, const int stride, float* rand_idx, Dtype* top_data) {
-  CUDA_KERNEL_LLOP(index, nthreads) {
+  CUDA_KERNEL_LOOP(index, nthreads) {
     int pw = index % pooled_width;
     int ph = (index / pooled_width) % pooled_height;
     int c = (index / pooled_width / pooled_height) % channels;