21 #ifndef _libint2_include_libint2intrinsicoperations_h_ 22 #define _libint2_include_libint2intrinsicoperations_h_ 24 #include <libint2/config.h> 32 #if defined(LIBINT_GENERATE_FMA) 33 # if defined(LIBINT_HAS_CXX11) 34 template <
typename X,
typename Y,
typename Z>
36 inline auto fma_plus(X x, Y y, Z z) -> decltype(x*y+z) {
41 template <
typename X,
typename Y,
typename Z>
42 inline auto fma_minus(X x, Y y, Z z) -> decltype(x*y-z) {
45 # else // LIBINT_HAS_CXX11 46 # error "support for FMA requires compiler capable of C++11 or later" 47 # endif // LIBINT_HAS_CXX11 48 #endif // LIBINT_GENERATE_FMA 58 #define _libint2_static_api_bzero_short_(X,nelem) for(int i=0; i < (nelem); ++i) { (X)[i] = 0.0; } 60 #define _libint2_static_api_copy_short_(X,Y,nelem) for(int i=0; i < (nelem); ++i) { (X)[i] = (Y)[i]; } 62 #define _libint2_static_api_scale_short_(X,Y,nelem,a) for(int i=0; i < (nelem); ++i) { (X)[i] = (a) * (Y)[i]; } 64 #define _libint2_static_api_scale_vec_short_(X,Y,nelem,a,vl) for(int i=0, iv=0; i < (nelem)/(vl); ++i) { for(int v=0; v < (vl); ++v, ++iv) { (X)[iv] = (a)[v] * (Y)[iv]; } } 66 #if defined(LIBINT_GENERATE_FMA) 67 # define _libint2_static_api_inc_short_(X,Y,nelem,a) for(int i=0; i < (nelem); ++i) { (X)[i] = libint2::fma_plus((a),(Y)[i],(X)[i]); } 69 # define _libint2_static_api_inc_short_(X,Y,nelem,a) for(int i=0; i < (nelem); ++i) { (X)[i] += (a) * (Y)[i]; } 72 #define _libint2_static_api_inc1_short_(X,Y,nelem) for(int i=0; i < (nelem); ++i) { (X)[i] += (Y)[i]; } Defaults definitions for various parameters assumed by Libint.
Definition: algebra.cc:24
auto fma_plus(X x, Y y, Z z) -> decltype(x *y+z)
Definition: intrinsic_operations.h:36
auto fma_minus(X x, Y y, Z z) -> decltype(x *y-z)
Definition: intrinsic_operations.h:42