示例#1
0
void
  daxpby(typename VectorType::ScalarType alpha, const VectorType& x,
         typename VectorType::ScalarType beta, VectorType& y)
{
  typedef typename VectorType::ScalarType ScalarType;

  const int n = MINIFE_MIN(x.coefs.size(), y.coefs.size());
  const MINIFE_SCALAR* xcoefs = &x.coefs[0];
        MINIFE_SCALAR* ycoefs = &y.coefs[0];

  #if defined(MINIFE_MKL_DOUBLE)
	cblas_daxpby(
  #elif defined(MINIFE_MKL_FLOAT)
	cblas_saxpby(
  #else
	#error "Unknown MINIFE MKL type"
  #endif
	(const MKL_INT) n,
	alpha,
	xcoefs,
	(const MKL_INT) 1,
	beta,
	ycoefs,
	(const MKL_INT) 1);
}
示例#2
0
void caffe_cpu_axpby<float>(const int N, const float alpha, const float* X,
                            const float beta, float* Y) {
    cblas_saxpby(N, alpha, X, 1, beta, Y, 1);
}
示例#3
0
void caffe_cpu_axpby_strided<float>(const int N, const float alpha, const float* X,
                            const float beta, float* Y, const int incy) {
  cblas_saxpby(N, alpha, X, 1, beta, Y, incy);
}