Dtype caffe_cpu_dot(const int n, const Dtype* x, const Dtype* y);
template <typename Dtype>
+Dtype caffe_cpu_strided_dot(const int n, const Dtype* x, const int incx,
+ const Dtype* y, const int incy);
+
+template <typename Dtype>
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
void caffe_rng_bernoulli<float>(const int n, const float p, unsigned int* r);
+template <typename Dtype>
+Dtype caffe_cpu_dot(const int n, const Dtype* x, const Dtype* y) {
+ return caffe_cpu_strided_dot(n, x, 1, y, 1);
+}
+
+template
+float caffe_cpu_dot<float>(const int n, const float* x, const float* y);
+
+template
+double caffe_cpu_dot<double>(const int n, const double* x, const double* y);
+
template <>
-float caffe_cpu_dot<float>(const int n, const float* x, const float* y) {
- return cblas_sdot(n, x, 1, y, 1);
+float caffe_cpu_strided_dot<float>(const int n, const float* x, const int incx,
+ const float* y, const int incy) {
+ return cblas_sdot(n, x, incx, y, incy);
}
template <>
-double caffe_cpu_dot<double>(const int n, const double* x, const double* y) {
- return cblas_ddot(n, x, 1, y, 1);
+double caffe_cpu_strided_dot<double>(const int n, const double* x,
+ const int incx, const double* y, const int incy) {
+ return cblas_ddot(n, x, incx, y, incy);
}
template <>