Rename caffe_hamming_distance into caffe_cpu_hamming_distance
authorKai Li <kaili_kloud@163.com>
Sat, 29 Mar 2014 12:20:58 +0000 (20:20 +0800)
committerKai Li <kaili_kloud@163.com>
Sat, 29 Mar 2014 12:20:58 +0000 (20:20 +0800)
include/caffe/util/math_functions.hpp
src/caffe/test/test_math_functions.cpp
src/caffe/util/math_functions.cpp

index ce62003..bccfbea 100644 (file)
@@ -110,7 +110,7 @@ template <typename Dtype>
 void caffe_gpu_dot(const int n, const Dtype* x, const Dtype* y, Dtype* out);
 
 template <typename Dtype>
-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 <typename Dtype>
index 354dad4..6693ce3 100644 (file)
@@ -70,12 +70,12 @@ REF_HAMMING_DIST(double, uint64_t);
 typedef ::testing::Types<float, double> 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<TypeParam>(n, x, y));
+           caffe_cpu_hamming_distance<TypeParam>(n, x, y));
 }
 
 TYPED_TEST(MathFunctionsTest, TestAsumCPU) {
index 80e420f..c621255 100644 (file)
@@ -369,7 +369,7 @@ void caffe_gpu_dot<double>(const int n, const double* x, const double* y,
 }
 
 template <>
-int caffe_hamming_distance<float>(const int n, const float* x,
+int caffe_cpu_hamming_distance<float>(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<float>(const int n, const float* x,
 }
 
 template <>
-int caffe_hamming_distance<double>(const int n, const double* x,
+int caffe_cpu_hamming_distance<double>(const int n, const double* x,
                                    const double* y) {
   int dist = 0;
   for (int i = 0; i < n; ++i) {