im2col: using cpu for now.
authorYangqing Jia <jiayq84@gmail.com>
Fri, 20 Sep 2013 00:35:44 +0000 (17:35 -0700)
committerYangqing Jia <jiayq84@gmail.com>
Fri, 20 Sep 2013 00:35:44 +0000 (17:35 -0700)
src/caffeine/layers/im2col_layer.cpp
src/caffeine/test/test_im2col_layer.cpp
src/caffeine/util/im2col.cu
src/caffeine/util/im2col.hpp

index 9fc6296..77108af 100644 (file)
@@ -57,6 +57,9 @@ Dtype Im2colLayer<Dtype>::Backward_cpu(const vector<Blob<Dtype>*>& top,
 template <typename Dtype>
 Dtype Im2colLayer<Dtype>::Backward_gpu(const vector<Blob<Dtype>*>& top,
       const bool propagate_down, vector<Blob<Dtype>*>* bottom) {
+  LOG(ERROR) << "Warning: still CPU version";
+  return Backward_cpu(top, propagate_down, bottom);
+  /*
   const Dtype* top_diff = top[0]->gpu_diff();
   Dtype* bottom_diff = (*bottom)[0]->mutable_gpu_diff();
   for (int n = 0; n < top[0]->num(); ++n) {
@@ -64,6 +67,7 @@ Dtype Im2colLayer<Dtype>::Backward_gpu(const vector<Blob<Dtype>*>& top,
         WIDTH_, KSIZE_, STRIDE_, bottom_diff + (*bottom)[0]->offset(n));
   }
   return Dtype(0.);
+  */
 }
 
 INSTANTIATE_CLASS(Im2colLayer);
index 6fa4d08..5236135 100644 (file)
@@ -88,7 +88,7 @@ TYPED_TEST(Im2colLayerTest, TestCPUGradient) {
   GradientChecker<TypeParam> checker(1e-2, 1e-2);
   checker.CheckGradientExhaustive(layer, this->blob_bottom_vec_, this->blob_top_vec_);
 }
-/*
+
 TYPED_TEST(Im2colLayerTest, TestGPUGradient) {
   LayerParameter layer_param;
   layer_param.set_kernelsize(3);
@@ -98,6 +98,6 @@ TYPED_TEST(Im2colLayerTest, TestGPUGradient) {
   GradientChecker<TypeParam> checker(1e-2, 1e-2);
   checker.CheckGradientExhaustive(layer, this->blob_bottom_vec_, this->blob_top_vec_);
 }
-*/
+
 
 }
index 88c8da0..22731f9 100644 (file)
@@ -57,6 +57,7 @@ template void im2col_gpu<double>(const double* data_im, const int channels,
     double* data_col);
 
 
+/*
 // A bunch of stuff dealing with double atomic add
 template <typename Dtype>
 __device__ inline Dtype MyAtomicAdd(Dtype* address, Dtype val);
@@ -78,8 +79,6 @@ __device__ double MyAtomicAdd<double>(double* address, double val)
   return __longlong_as_double(old);
 }
 
-
-
 template <typename Dtype>
 __global__ void col2im_gpu_kernel(const int n, const Dtype* data_col,
   const int height, const int width, const int ksize,
@@ -121,5 +120,6 @@ template void col2im_gpu<float>(const float* data_col, const int channels,
 template void col2im_gpu<double>(const double* data_col, const int channels,
     const int height, const int width, const int psize, const int stride,
     double* data_im);
+*/
 
 }  // namespace caffeine
index f634990..23e571e 100644 (file)
@@ -18,11 +18,12 @@ void im2col_gpu(const Dtype* data_im, const int channels,
     const int height, const int width, const int ksize, const int stride,
     Dtype* data_col);
 
+/*
 template <typename Dtype>
 void col2im_gpu(const Dtype* data_col, const int channels,
     const int height, const int width, const int psize, const int stride,
     Dtype* data_im);
-
+*/
 }  // namespace caffeine
 
 #endif  // CAFFEINE_UTIL_IM2COL_HPP_