vSMC
vSMC: Scalable Monte Carlo
Namespaces | Macros | Functions
cblas.hpp File Reference
#include <vsmc/internal/config.hpp>
#include <cmath>
#include <numeric>
#include <mkl.h>

Go to the source code of this file.

Namespaces

 vsmc
 
 vsmc::math
 

Macros

#define VSMC_CBLAS_INT   MKL_INT
 
#define VSMC_CBLAS_THRESHOLD   1000
 When MKL or vecLib CBLAS is available, the threshold of the number of elements above which these libraries will be used. More...
 
#define VSMC_DEFINE_MATH_CBLAS_S1(name, sname, dname)
 
#define VSMC_DEFINE_MATH_CBLAS_S2(name, sname, dname)
 
#define VSMC_DEFINE_MATH_CBLAS_SV(name, sname, dname)
 

Functions

template<typename T >
vsmc::math::asum (std::size_t n, const T *x)
 Sum of vector magnitudes. More...
 
float vsmc::math::asum (std::size_t n, const float *x)
 
double vsmc::math::asum (std::size_t n, const double *x)
 
template<typename T >
vsmc::math::dot (std::size_t n, const T *x, const T *y)
 The dot product. More...
 
double vsmc::math::dot (std::size_t n, const double *x, const double *y)
 
float vsmc::math::dot (std::size_t n, const float *x, const float *y)
 
template<typename T >
void vsmc::math::scal (std::size_t n, T a, T *x)
 Scale a vector. More...
 
void vsmc::math::scal (std::size_t n, double a, double *x)
 
void vsmc::math::scal (std::size_t n, float a, float *x)
 

Macro Definition Documentation

#define VSMC_CBLAS_INT   MKL_INT

Definition at line 41 of file cblas.hpp.

#define VSMC_DEFINE_MATH_CBLAS_S1 (   name,
  sname,
  dname 
)
Value:
inline float name (std::size_t n, const float *x) \
{ \
return n < VSMC_CBLAS_THRESHOLD ? \
name<float>(n, x): \
::cblas_##sname(static_cast<VSMC_CBLAS_INT>(n), x, 1); \
} \
inline double name (std::size_t n, const double *x) \
{ \
return n < VSMC_CBLAS_THRESHOLD ? \
name<double>(n, x): \
::cblas_##dname(static_cast<VSMC_CBLAS_INT>(n), x, 1); \
}
#define VSMC_CBLAS_THRESHOLD
When MKL or vecLib CBLAS is available, the threshold of the number of elements above which these libr...
Definition: cblas.hpp:51

Definition at line 92 of file cblas.hpp.

#define VSMC_DEFINE_MATH_CBLAS_S2 (   name,
  sname,
  dname 
)
Value:
inline float name (std::size_t n, const float *x, const float *y) \
{ \
return n < VSMC_CBLAS_THRESHOLD ? \
name<float>(n, x, y): \
::cblas_##sname(static_cast<VSMC_CBLAS_INT>(n), x, 1, y, 1); \
} \
inline double name (std::size_t n, const double *x, const double *y) \
{ \
return n < VSMC_CBLAS_THRESHOLD ? \
name<double>(n, x, y): \
::cblas_##dname(static_cast<VSMC_CBLAS_INT>(n), x, 1, y, 1); \
}
#define VSMC_CBLAS_THRESHOLD
When MKL or vecLib CBLAS is available, the threshold of the number of elements above which these libr...
Definition: cblas.hpp:51

Definition at line 106 of file cblas.hpp.

#define VSMC_DEFINE_MATH_CBLAS_SV (   name,
  sname,
  dname 
)
Value:
inline void name (std::size_t n, float a, float *x) \
{ \
name<float>(n, a, x): \
::cblas_##sname(static_cast<VSMC_CBLAS_INT>(n), a, x, 1); \
} \
inline void name (std::size_t n, double a, double *x) \
{ \
name<double>(n, a, x): \
::cblas_##dname(static_cast<VSMC_CBLAS_INT>(n), a, x, 1); \
}
#define VSMC_CBLAS_THRESHOLD
When MKL or vecLib CBLAS is available, the threshold of the number of elements above which these libr...
Definition: cblas.hpp:51

Definition at line 120 of file cblas.hpp.