diff options
author | Evan Shelhamer <shelhamer@imaginarynumber.net> | 2014-06-28 01:52:49 -0700 |
---|---|---|
committer | Evan Shelhamer <shelhamer@imaginarynumber.net> | 2014-07-03 17:20:28 -0700 |
commit | af624faa55eb75f31de5f612b3d6b1553d652563 (patch) | |
tree | 2e373c390af670653d452c978ba242a79128d788 /src/caffe/util/im2col.cpp | |
parent | 1da30a555827e778e36c5db72ef9cc672ad85675 (diff) | |
download | caffeonacl-af624faa55eb75f31de5f612b3d6b1553d652563.tar.gz caffeonacl-af624faa55eb75f31de5f612b3d6b1553d652563.tar.bz2 caffeonacl-af624faa55eb75f31de5f612b3d6b1553d652563.zip |
replace all memset with caffe_set() / caffe_gpu_set()
...except for `SyncedMem` since it has no type.
Diffstat (limited to 'src/caffe/util/im2col.cpp')
-rw-r--r-- | src/caffe/util/im2col.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/caffe/util/im2col.cpp b/src/caffe/util/im2col.cpp index 037410e2..ce4e1884 100644 --- a/src/caffe/util/im2col.cpp +++ b/src/caffe/util/im2col.cpp @@ -5,6 +5,7 @@ #include <cstring> #include "caffe/util/im2col.hpp" +#include "caffe/util/math_functions.hpp" namespace caffe { @@ -45,7 +46,7 @@ template <typename Dtype> void col2im_cpu(const Dtype* data_col, const int channels, const int height, const int width, const int ksize, const int pad, const int stride, Dtype* data_im) { - memset(data_im, 0, sizeof(Dtype) * height * width * channels); + caffe_set(height * width * channels, Dtype(0), data_im); int height_col = (height + 2 * pad - ksize) / stride + 1; int width_col = (width + 2 * pad - ksize) / stride + 1; int channels_col = channels * ksize * ksize; |