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>
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) {
}
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) {
}
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) {