21 #ifndef _libint2_src_lib_libint_osvrrxsxs_h_ 22 #define _libint2_src_lib_libint_osvrrxsxs_h_ 26 #include <util_types.h> 27 #include <libint2/cgshell_ordering.h> 31 template <
int part,
int La,
int Lc,
bool unit_b,
bool vectorize>
struct OSVRR_xs_xs {
32 static void compute(
const Libint_t* inteval,
33 LIBINT2_REALTYPE* target,
34 const LIBINT2_REALTYPE* src0,
35 const LIBINT2_REALTYPE* src1,
36 const LIBINT2_REALTYPE* src2,
37 const LIBINT2_REALTYPE* src3,
38 const LIBINT2_REALTYPE* src4);
48 template <
int La,
int Lc,
50 bool vectorize>
struct OSVRR_xs_xs<0,La,Lc,unit_b,vectorize> {
52 static void compute(
const Libint_t* inteval,
53 LIBINT2_REALTYPE* target,
54 const LIBINT2_REALTYPE* src0,
55 const LIBINT2_REALTYPE* src1,
56 const LIBINT2_REALTYPE* src2,
57 const LIBINT2_REALTYPE* src3,
58 const LIBINT2_REALTYPE* src4) {
61 assert(not (La < 2 || Lc < 1));
63 const unsigned int veclen = vectorize ? inteval->veclen : 1;
65 const unsigned int Nc = INT_NCART(Lc);
66 const unsigned int NcV = Nc * veclen;
69 FOR_CART(ax, ay, az, La)
71 int a[3]; a[0] = ax; a[1] = ay; a[2] = az;
73 enum XYZ {x=0, y=1, z=2};
81 const LIBINT2_REALTYPE *PA, *WP;
84 #if LIBINT2_DEFINED(eri,PA_x) 85 if (not unit_b) PA = inteval->PA_x;
90 #if LIBINT2_DEFINED(eri,PA_y) 91 if (not unit_b) PA = inteval->PA_y;
96 #if LIBINT2_DEFINED(eri,PA_z) 97 if (not unit_b) PA = inteval->PA_z;
103 const unsigned int iam1 = INT_CARTINDEX(La-1,a[0],a[1]);
104 const unsigned int am10c0_offset = iam1 * NcV;
105 const LIBINT2_REALTYPE* src0_ptr = unit_b ? 0 : src0 + am10c0_offset;
106 const LIBINT2_REALTYPE* src1_ptr = src1 + am10c0_offset;
111 const unsigned int iam2 = INT_CARTINDEX(La-2,a[0],a[1]);
112 const unsigned int am20c0_offset = iam2 * NcV;
114 const LIBINT2_REALTYPE* src2_ptr = src2 + am20c0_offset;
115 const LIBINT2_REALTYPE* src3_ptr = src3 + am20c0_offset;
116 const LIBINT2_REALTYPE axyz = (LIBINT2_REALTYPE)a[xyz];
119 for(
unsigned int c = 0; c < Nc; ++c) {
120 for(
unsigned int v=0; v<veclen; ++v, ++cv) {
121 LIBINT2_REALTYPE value = WP[v] * src1_ptr[cv] + axyz * inteval->oo2z[v] * (src2_ptr[cv] - inteval->roz[v] * src3_ptr[cv]);
122 if (not unit_b) value += PA[v] * src0_ptr[cv];
126 #if LIBINT2_FLOP_COUNT 127 inteval->nflops[0] += (unit_b ? 6 : 8) * NcV;
133 for(
unsigned int c = 0; c < Nc; ++c) {
134 for(
unsigned int v=0; v<veclen; ++v, ++cv) {
135 LIBINT2_REALTYPE value = WP[v] * src1_ptr[cv];
136 if (not unit_b) value += PA[v] * src0_ptr[cv];
140 #if LIBINT2_FLOP_COUNT 141 inteval->nflops[0] += (unit_b ? 1 : 3) * NcV;
146 const unsigned int Ncm1 = INT_NCART(Lc-1);
147 const unsigned int Ncm1V = Ncm1 * veclen;
148 const unsigned int am10cm10_offset = iam1 * Ncm1V;
149 const LIBINT2_REALTYPE* src4_ptr = src4 + am10cm10_offset;
153 FOR_CART(cx, cy, cz, Lc-1)
155 int c[3]; c[0] = cx; c[1] = cy; c[2] = cz;
158 const unsigned int cc = INT_CARTINDEX(Lc,c[0],c[1]);
159 const unsigned int cc_offset = cc * veclen;
160 LIBINT2_REALTYPE* tptr = target + cc_offset;
161 const LIBINT2_REALTYPE cxyz = (LIBINT2_REALTYPE)c[xyz];
162 for(
unsigned int v=0; v<veclen; ++v) {
163 tptr[v] += cxyz * inteval->oo2ze[v] * src4_ptr[v];
165 #if LIBINT2_FLOP_COUNT 166 inteval->nflops[0] += 3 * veclen;
185 template <
int part,
int La,
int Lc,
bool vectorize>
struct OSAVRR_xs_xs {
186 static void compute(
const Libint_t* inteval,
187 LIBINT2_REALTYPE* target,
188 const LIBINT2_REALTYPE* src1,
189 const LIBINT2_REALTYPE* src4);
196 template <
int La,
int Lc,
bool vectorize>
struct OSAVRR_xs_xs<0,La,Lc,vectorize> {
199 LIBINT2_REALTYPE* target,
200 const LIBINT2_REALTYPE* src1,
201 const LIBINT2_REALTYPE* src4) {
204 assert(not (La < 1 || Lc < 1));
206 const unsigned int veclen = vectorize ? inteval->veclen : 1;
208 const unsigned int Nc = INT_NCART(Lc);
209 const unsigned int NcV = Nc * veclen;
212 FOR_CART(ax, ay, az, La)
214 int a[3]; a[0] = ax; a[1] = ay; a[2] = az;
216 enum XYZ {x=0, y=1, z=2};
219 if (ay != 0) xyz = y;
220 if (ax != 0) xyz = x;
224 const LIBINT2_REALTYPE *WP;
237 const unsigned int iam1 = INT_CARTINDEX(La-1,a[0],a[1]);
238 const unsigned int am10c0_offset = iam1 * NcV;
239 const LIBINT2_REALTYPE* src1_ptr = src1 + am10c0_offset;
243 for(
unsigned int c = 0; c < Nc; ++c) {
244 for(
unsigned int v=0; v<veclen; ++v, ++cv) {
245 target[cv] = WP[v] * src1_ptr[cv];
248 #if LIBINT2_FLOP_COUNT 249 inteval->nflops[0] += NcV;
254 const unsigned int Ncm1 = INT_NCART(Lc-1);
255 const unsigned int Ncm1V = Ncm1 * veclen;
256 const unsigned int am10cm10_offset = iam1 * Ncm1V;
257 const LIBINT2_REALTYPE* src4_ptr = src4 + am10cm10_offset;
261 FOR_CART(cx, cy, cz, Lc-1)
263 int c[3]; c[0] = cx; c[1] = cy; c[2] = cz;
266 const unsigned int cc = INT_CARTINDEX(Lc,c[0],c[1]);
267 const unsigned int cc_offset = cc * veclen;
268 LIBINT2_REALTYPE* tptr = target + cc_offset;
269 const LIBINT2_REALTYPE cxyz = (LIBINT2_REALTYPE)c[xyz];
270 for(
unsigned int v=0; v<veclen; ++v) {
271 tptr[v] += cxyz * inteval->oo2ze[v] * src4_ptr[v];
273 #if LIBINT2_FLOP_COUNT 274 inteval->nflops[0] += 3 * veclen;
294 #endif // header guard static void compute(const Libint_t *inteval, LIBINT2_REALTYPE *target, const LIBINT2_REALTYPE *src1, const LIBINT2_REALTYPE *src4)
Definition: OSVRR_xs_xs.h:198
static void compute(const Libint_t *inteval, LIBINT2_REALTYPE *target, const LIBINT2_REALTYPE *src0, const LIBINT2_REALTYPE *src1, const LIBINT2_REALTYPE *src2, const LIBINT2_REALTYPE *src3, const LIBINT2_REALTYPE *src4)
Definition: OSVRR_xs_xs.h:52
Definition: OSVRR_xs_xs.h:185
Defaults definitions for various parameters assumed by Libint.
Definition: algebra.cc:24
Definition: OSVRR_xs_xs.h:31