49 static void compute(
const Libint_t* inteval, LIBINT2_REALTYPE* target,
50 const LIBINT2_REALTYPE* src0,
51 const LIBINT2_REALTYPE* src1,
52 const LIBINT2_REALTYPE* src2,
53 const LIBINT2_REALTYPE* src3) {
55 if (La < 2 || Lc < 1) abort();
57 const unsigned int veclen = vectorize ? inteval->veclen : 1;
59 const unsigned int Nc = INT_NCART(Lc);
60 const unsigned int NcV = Nc * veclen;
63 FOR_CART(ax, ay, az, La)
70 enum XYZ { x = 0, y = 1, z = 2 };
78 const LIBINT2_REALTYPE* pfac0;
82#if LIBINT2_DEFINED(eri, TwoPRepITR_pfac0_0_0_x)
83 inteval->TwoPRepITR_pfac0_0_0_x
88#if LIBINT2_DEFINED(eri, TwoPRepITR_pfac0_0_1_x)
89 inteval->TwoPRepITR_pfac0_0_1_x;
97#if LIBINT2_DEFINED(eri, TwoPRepITR_pfac0_0_0_y)
98 inteval->TwoPRepITR_pfac0_0_0_y
103#if LIBINT2_DEFINED(eri, TwoPRepITR_pfac0_0_1_y)
104 inteval->TwoPRepITR_pfac0_0_1_y;
112#if LIBINT2_DEFINED(eri, TwoPRepITR_pfac0_0_0_z)
113 inteval->TwoPRepITR_pfac0_0_0_z
118#if LIBINT2_DEFINED(eri, TwoPRepITR_pfac0_0_1_z)
119 inteval->TwoPRepITR_pfac0_0_1_z;
127 const unsigned int iam1 = INT_CARTINDEX(La - 1, a[0], a[1]);
128 const unsigned int am10c0_offset = iam1 * NcV;
129 const LIBINT2_REALTYPE* src0_ptr = src0 + am10c0_offset;
134 const unsigned int iam2 = INT_CARTINDEX(La - 2, a[0], a[1]);
135 const unsigned int am20c0_offset = iam2 * NcV;
137 const LIBINT2_REALTYPE* src2_ptr = src2 + am20c0_offset;
138 const LIBINT2_REALTYPE axyz = (LIBINT2_REALTYPE)a[xyz];
141 for (
unsigned int c = 0; c < Nc; ++c) {
142 for (
unsigned int v = 0; v < veclen; ++v, ++cv) {
144 pfac0[v] * src0_ptr[cv] + axyz * inteval->oo2z[v] * src2_ptr[cv];
147#if LIBINT2_FLOP_COUNT
148 inteval->nflops[0] += 4 * NcV;
153 for (
unsigned int c = 0; c < Nc; ++c) {
154 for (
unsigned int v = 0; v < veclen; ++v, ++cv) {
155 target[cv] = pfac0[v] * src0_ptr[cv];
158#if LIBINT2_FLOP_COUNT
159 inteval->nflops[0] += 1 * NcV;
164 const unsigned int Ncp1 = INT_NCART(Lc + 1);
165 const unsigned int Ncp1V = Ncp1 * veclen;
166 const unsigned int am10cp10_offset = iam1 * Ncp1V;
167 const LIBINT2_REALTYPE* src1_ptr = src1 + am10cp10_offset;
172 FOR_CART(cx, cy, cz, Lc)
180 const unsigned int cp1 = INT_CARTINDEX(Lc + 1, c[0], c[1]);
181 const unsigned int cp1_offset = cp1 * veclen;
182 const LIBINT2_REALTYPE* sptr = src1_ptr + cp1_offset;
183 const LIBINT2_REALTYPE cxyz = (LIBINT2_REALTYPE)c[xyz];
184 for (
unsigned int v = 0; v < veclen; ++v, ++cv) {
185 target[cv] -= inteval->eoz[v] * sptr[v];
187#if LIBINT2_FLOP_COUNT
188 inteval->nflops[0] += 2 * veclen;
195 const unsigned int Ncm1 = INT_NCART(Lc - 1);
196 const unsigned int Ncm1V = Ncm1 * veclen;
197 const unsigned int am10cm10_offset = iam1 * Ncm1V;
198 const LIBINT2_REALTYPE* src3_ptr = src3 + am10cm10_offset;
202 FOR_CART(cx, cy, cz, Lc - 1)
210 const unsigned int cc = INT_CARTINDEX(Lc, c[0], c[1]);
211 const unsigned int cc_offset = cc * veclen;
212 LIBINT2_REALTYPE* tptr = target + cc_offset;
213 const LIBINT2_REALTYPE cxyz = (LIBINT2_REALTYPE)c[xyz];
214 for (
unsigned int v = 0; v < veclen; ++v) {
215 tptr[v] += cxyz * inteval->oo2z[v] * src3_ptr[v];
217#if LIBINT2_FLOP_COUNT
218 inteval->nflops[0] += 3 * veclen;
238 template <
int La,
int Lc,
bool InBra,
bool vectorize>
struct ITR_xs_xs<1,La,Lc,InBra,vectorize> {
240 static void compute(
const Libint_t* inteval,
241 LIBINT2_REALTYPE* target,
242 const LIBINT2_REALTYPE* src0,
243 const LIBINT2_REALTYPE* src1,
244 const LIBINT2_REALTYPE* src2,
245 const LIBINT2_REALTYPE* src3) {
248 if (La < 1 || Lc < 2)
251 const unsigned int veclen = vectorize ? inteval->veclen : 1;
253 const unsigned int Na = INT_NCART(La);
254 const unsigned int NaV = Na * veclen;
257 FOR_CART(cx, cy, cz, Lc)
259 int c[3]; c[0] = cx; c[1] = cy; c[2] = cz;
261 enum XYZ {x=0, y=1, z=2};
264 if (cy != 0) xyz = y;
265 if (cx != 0) xyz = x;
269 const LIBINT2_REALTYPE *pfac0;
273#if LIBINT2_DEFINED(eri, TwoPRepITR_pfac0_1_0_x)
274 inteval->TwoPRepITR_pfac0_1_0_x
279#if LIBINT2_DEFINED(eri, TwoPRepITR_pfac0_0_1_x)
280 inteval->TwoPRepITR_pfac0_0_1_x;
288#if LIBINT2_DEFINED(eri, TwoPRepITR_pfac0_1_0_y)
289 inteval->TwoPRepITR_pfac0_1_0_y
294#if LIBINT2_DEFINED(eri, TwoPRepITR_pfac0_1_1_y)
295 inteval->TwoPRepITR_pfac0_1_1_y;
303#if LIBINT2_DEFINED(eri, TwoPRepITR_pfac0_1_0_z)
304 inteval->TwoPRepITR_pfac0_1_0_z
309#if LIBINT2_DEFINED(eri, TwoPRepITR_pfac0_1_1_z)
310 inteval->TwoPRepITR_pfac0_1_1_z;
318 const unsigned int icm1 = INT_CARTINDEX(Lc-1,c[0],c[1]);
319 const unsigned int a0cm10_offset = icm1 * NaV;
320 const LIBINT2_REALTYPE* src0_ptr = src0 + a0cm10_offset;
325 const unsigned int icm2 = INT_CARTINDEX(Lc-2,c[0],c[1]);
326 const unsigned int a0cm20_offset = icm2 * NaV;
328 const LIBINT2_REALTYPE* src2_ptr = src2 + am20c0_offset;
329 const LIBINT2_REALTYPE axyz = (LIBINT2_REALTYPE)c[xyz];
332 for(
unsigned int c = 0; c < Nc; ++c) {
333 for(
unsigned int v=0; v<veclen; ++v, ++cv) {
334 target[cv] = pfac0[v] * src0_ptr[cv] + axyz * inteval->oo2z[v] * src2_ptr[cv];
337#if LIBINT2_FLOP_COUNT
338 inteval->nflops[0] += 4 * NcV;
344 for(
unsigned int c = 0; c < Nc; ++c) {
345 for(
unsigned int v=0; v<veclen; ++v, ++cv) {
346 target[cv] = pfac0[v] * src0_ptr[cv];
349#if LIBINT2_FLOP_COUNT
350 inteval->nflops[0] += 1 * NcV;
355 const unsigned int Ncp1 = INT_NCART(Lc+1);
356 const unsigned int Ncp1V = Ncp1 * veclen;
357 const unsigned int am10cp10_offset = iam1 * Ncp1V;
358 const LIBINT2_REALTYPE* src1_ptr = src1 + am10cp10_offset;
363 FOR_CART(cx, cy, cz, Lc)
365 int c[3]; c[0] = cx; c[1] = cy; c[2] = cz;
368 const unsigned int cp1 = INT_CARTINDEX(Lc+1,c[0],c[1]);
369 const unsigned int cp1_offset = cp1 * veclen;
370 const LIBINT2_REALTYPE* sptr = src1_ptr + cp1_offset;
371 const LIBINT2_REALTYPE cxyz = (LIBINT2_REALTYPE)c[xyz];
372 for(
unsigned int v=0; v<veclen; ++v, ++cv) {
373 target[cv] -= inteval->eoz[v] * sptr[v];
375#if LIBINT2_FLOP_COUNT
376 inteval->nflops[0] += 2 * veclen;
384 const unsigned int Ncm1 = INT_NCART(Lc-1);
385 const unsigned int Ncm1V = Ncm1 * veclen;
386 const unsigned int am10cm10_offset = iam1 * Ncm1V;
387 const LIBINT2_REALTYPE* src3_ptr = src3 + am10cm10_offset;
391 FOR_CART(cx, cy, cz, Lc-1)
393 int c[3]; c[0] = cx; c[1] = cy; c[2] = cz;
396 const unsigned int cc = INT_CARTINDEX(Lc,c[0],c[1]);
397 const unsigned int cc_offset = cc * veclen;
398 LIBINT2_REALTYPE* tptr = target + cc_offset;
399 const LIBINT2_REALTYPE cxyz = (LIBINT2_REALTYPE)c[xyz];
400 for(
unsigned int v=0; v<veclen; ++v) {
401 tptr[v] += cxyz * inteval->oo2z[v] * src3_ptr[v];
403#if LIBINT2_FLOP_COUNT
404 inteval->nflops[0] += 3 * veclen;