From: Yangqing Jia Date: Fri, 20 Sep 2013 00:35:44 +0000 (-0700) Subject: im2col: using cpu for now. X-Git-Tag: submit/tizen/20180823.020014~1031 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e5401e60ae71c8621b7244e3dab9f2d014d0775f;p=platform%2Fupstream%2Fcaffeonacl.git im2col: using cpu for now. --- diff --git a/src/caffeine/layers/im2col_layer.cpp b/src/caffeine/layers/im2col_layer.cpp index 9fc6296..77108af 100644 --- a/src/caffeine/layers/im2col_layer.cpp +++ b/src/caffeine/layers/im2col_layer.cpp @@ -57,6 +57,9 @@ Dtype Im2colLayer::Backward_cpu(const vector*>& top, template Dtype Im2colLayer::Backward_gpu(const vector*>& top, const bool propagate_down, vector*>* 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::Backward_gpu(const vector*>& top, WIDTH_, KSIZE_, STRIDE_, bottom_diff + (*bottom)[0]->offset(n)); } return Dtype(0.); + */ } INSTANTIATE_CLASS(Im2colLayer); diff --git a/src/caffeine/test/test_im2col_layer.cpp b/src/caffeine/test/test_im2col_layer.cpp index 6fa4d08..5236135 100644 --- a/src/caffeine/test/test_im2col_layer.cpp +++ b/src/caffeine/test/test_im2col_layer.cpp @@ -88,7 +88,7 @@ TYPED_TEST(Im2colLayerTest, TestCPUGradient) { GradientChecker 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 checker(1e-2, 1e-2); checker.CheckGradientExhaustive(layer, this->blob_bottom_vec_, this->blob_top_vec_); } -*/ + } diff --git a/src/caffeine/util/im2col.cu b/src/caffeine/util/im2col.cu index 88c8da0..22731f9 100644 --- a/src/caffeine/util/im2col.cu +++ b/src/caffeine/util/im2col.cu @@ -57,6 +57,7 @@ template void im2col_gpu(const double* data_im, const int channels, double* data_col); +/* // A bunch of stuff dealing with double atomic add template __device__ inline Dtype MyAtomicAdd(Dtype* address, Dtype val); @@ -78,8 +79,6 @@ __device__ double MyAtomicAdd(double* address, double val) return __longlong_as_double(old); } - - template __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(const float* data_col, const int channels, template void col2im_gpu(const double* data_col, const int channels, const int height, const int width, const int psize, const int stride, double* data_im); +*/ } // namespace caffeine diff --git a/src/caffeine/util/im2col.hpp b/src/caffeine/util/im2col.hpp index f634990..23e571e 100644 --- a/src/caffeine/util/im2col.hpp +++ b/src/caffeine/util/im2col.hpp @@ -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 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_