From: Kai Li Date: Sat, 29 Mar 2014 12:20:58 +0000 (+0800) Subject: Rename caffe_hamming_distance into caffe_cpu_hamming_distance X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=db7ea5e2fbb3e095cf465a1802801514801691ee;p=platform%2Fupstream%2Fcaffe.git Rename caffe_hamming_distance into caffe_cpu_hamming_distance --- diff --git a/include/caffe/util/math_functions.hpp b/include/caffe/util/math_functions.hpp index ce62003..bccfbea 100644 --- a/include/caffe/util/math_functions.hpp +++ b/include/caffe/util/math_functions.hpp @@ -110,7 +110,7 @@ template void caffe_gpu_dot(const int n, const Dtype* x, const Dtype* y, Dtype* out); template -int caffe_hamming_distance(const int n, const Dtype* x, const Dtype* y); +int caffe_cpu_hamming_distance(const int n, const Dtype* x, const Dtype* y); // Returns the sum of the absolute values of the elements of vector x template diff --git a/src/caffe/test/test_math_functions.cpp b/src/caffe/test/test_math_functions.cpp index 354dad4..6693ce3 100644 --- a/src/caffe/test/test_math_functions.cpp +++ b/src/caffe/test/test_math_functions.cpp @@ -70,12 +70,12 @@ REF_HAMMING_DIST(double, uint64_t); typedef ::testing::Types Dtypes; TYPED_TEST_CASE(MathFunctionsTest, Dtypes); -TYPED_TEST(MathFunctionsTest, TestHammingDistance) { +TYPED_TEST(MathFunctionsTest, TestHammingDistanceCPU) { int n = this->blob_bottom_->count(); const TypeParam* x = this->blob_bottom_->cpu_data(); const TypeParam* y = this->blob_top_->cpu_data(); CHECK_EQ(this->ReferenceHammingDistance(n, x, y), - caffe_hamming_distance(n, x, y)); + caffe_cpu_hamming_distance(n, x, y)); } TYPED_TEST(MathFunctionsTest, TestAsumCPU) { diff --git a/src/caffe/util/math_functions.cpp b/src/caffe/util/math_functions.cpp index 80e420f..c621255 100644 --- a/src/caffe/util/math_functions.cpp +++ b/src/caffe/util/math_functions.cpp @@ -369,7 +369,7 @@ void caffe_gpu_dot(const int n, const double* x, const double* y, } template <> -int caffe_hamming_distance(const int n, const float* x, +int caffe_cpu_hamming_distance(const int n, const float* x, const float* y) { int dist = 0; for (int i = 0; i < n; ++i) { @@ -380,7 +380,7 @@ int caffe_hamming_distance(const int n, const float* x, } template <> -int caffe_hamming_distance(const int n, const double* x, +int caffe_cpu_hamming_distance(const int n, const double* x, const double* y) { int dist = 0; for (int i = 0; i < n; ++i) {