20 #ifndef QMCPLUSPLUS_VECTORIZED_STDMATH_HPP 21 #define QMCPLUSPLUS_VECTORIZED_STDMATH_HPP 24 #if defined(HAVE_MKL_VML) 25 #include <mkl_vml_functions.h> 26 #elif defined(HAVE_MASSV) 37 template<
typename T,
typename SIZET>
38 inline void remainder(
const T* restrict in, T* restrict out, SIZET
n)
40 for (SIZET i = 0; i <
n; ++i)
44 template<
typename T,
typename SIZET>
47 for (SIZET i = 0; i <
n; ++i)
51 template<
typename T,
typename SIZET>
52 inline void sqrt(T* restrict inout, SIZET
n)
54 for (SIZET i = 0; i <
n; ++i)
59 inline void sqrt(
const T* restrict in, T* restrict out,
int n)
61 for (
int i = 0; i <
n; ++i)
65 inline void inv(
const T* restrict in, T* restrict out,
int n)
67 for (
int i = 0; i <
n; ++i)
71 #if defined(HAVE_MKL_VML) 72 inline void sqrt(
const double* in,
double* out,
int n) { vdSqrt(
n, in, out); }
74 inline void sqrt(
const float* in,
float* out,
int n) { vsSqrt(
n, in, out); }
76 inline void inv(
const double* in,
double* out,
int n) { vdInv(
n, in, out); }
78 inline void inv(
const float* in,
float* out,
int n) { vsInv(
n, in, out); }
80 inline void inv_sqrt(
const double* in,
double* out,
int n) { vdInvSqrt(
n, in, out); }
82 inline void inv_sqrt(
const float* in,
float* out,
int n) { vsInvSqrt(
n, in, out); }
84 #elif defined(HAVE_MASSV) 86 inline void sqrt(
double* in,
double* out,
int n) { vsqrt(out, in, &
n); }
87 inline void sqrt(
float* in,
float* out,
int n) { vssqrt(out, in, &
n); }
88 inline void inv(
double* in,
double* out,
int n) { vrec(out, in, &
n); }
89 inline void inv(
float* in,
float* out,
int n) { vsrec(out, in, &
n); }
90 inline void inv_sqrt(
double* in,
double* out,
int n) { vrsqrt(out, in, &
n); }
91 inline void inv_sqrt(
float* in,
float* out,
int n) { vsrsqrt(out, in, &
n); }
95 inline void add(
int n,
const T* restrict in, T* restrict out)
97 for (
int i = 0; i <
n; ++i)
helper functions for EinsplineSetBuilder
void inv(const T *restrict in, T *restrict out, int n)
void add(int n, const T *restrict in, T *restrict out)
void remainder(const T *restrict in, T *restrict out, SIZET n)
mod on an array out[i]=in[i]-floor(in[i])
void sqrt(const T *restrict in, T *restrict out, int n)
void sqrt(T *restrict inout, SIZET n)
MakeReturn< UnaryNode< FnFloor, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t floor(const Vector< T1, C1 > &l)