21 #ifndef _libint2_src_lib_libint_itrxsxs_h_ 22 #define _libint2_src_lib_libint_itrxsxs_h_ 26 #include <util_types.h> 27 #include <libint2/cgshell_ordering.h> 31 template <
int part,
int La,
int Lc,
bool InBra,
bool vectorize>
struct ITR_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);
46 template <
int La,
int Lc,
bool InBra,
bool vectorize>
struct ITR_xs_xs<0,La,Lc,InBra,vectorize> {
48 static void compute(
const Libint_t* inteval,
49 LIBINT2_REALTYPE* target,
50 const LIBINT2_REALTYPE* src0,
51 const LIBINT2_REALTYPE* src1,
52 const LIBINT2_REALTYPE* src2,
53 const LIBINT2_REALTYPE* src3) {
59 const unsigned int veclen = vectorize ? inteval->veclen : 1;
61 const unsigned int Nc = INT_NCART(Lc);
62 const unsigned int NcV = Nc * veclen;
65 FOR_CART(ax, ay, az, La)
67 int a[3]; a[0] = ax; a[1] = ay; a[2] = az;
69 enum XYZ {x=0, y=1, z=2};
77 const LIBINT2_REALTYPE *pfac0;
81 #if LIBINT2_DEFINED(eri,TwoPRepITR_pfac0_0_0_x) 82 inteval->TwoPRepITR_pfac0_0_0_x
87 #if LIBINT2_DEFINED(eri,TwoPRepITR_pfac0_0_1_x) 88 inteval->TwoPRepITR_pfac0_0_1_x;
96 #if LIBINT2_DEFINED(eri,TwoPRepITR_pfac0_0_0_y) 97 inteval->TwoPRepITR_pfac0_0_0_y
102 #if LIBINT2_DEFINED(eri,TwoPRepITR_pfac0_0_1_y) 103 inteval->TwoPRepITR_pfac0_0_1_y;
111 #if LIBINT2_DEFINED(eri,TwoPRepITR_pfac0_0_0_z) 112 inteval->TwoPRepITR_pfac0_0_0_z
117 #if LIBINT2_DEFINED(eri,TwoPRepITR_pfac0_0_1_z) 118 inteval->TwoPRepITR_pfac0_0_1_z;
126 const unsigned int iam1 = INT_CARTINDEX(La-1,a[0],a[1]);
127 const unsigned int am10c0_offset = iam1 * NcV;
128 const LIBINT2_REALTYPE* src0_ptr = src0 + am10c0_offset;
133 const unsigned int iam2 = INT_CARTINDEX(La-2,a[0],a[1]);
134 const unsigned int am20c0_offset = iam2 * NcV;
136 const LIBINT2_REALTYPE* src2_ptr = src2 + am20c0_offset;
137 const LIBINT2_REALTYPE axyz = (LIBINT2_REALTYPE)a[xyz];
140 for(
unsigned int c = 0; c < Nc; ++c) {
141 for(
unsigned int v=0; v<veclen; ++v, ++cv) {
142 target[cv] = pfac0[v] * src0_ptr[cv] + axyz * inteval->oo2z[v] * src2_ptr[cv];
145 #if LIBINT2_FLOP_COUNT 146 inteval->nflops[0] += 4 * NcV;
152 for(
unsigned int c = 0; c < Nc; ++c) {
153 for(
unsigned int v=0; v<veclen; ++v, ++cv) {
154 target[cv] = pfac0[v] * src0_ptr[cv];
157 #if LIBINT2_FLOP_COUNT 158 inteval->nflops[0] += 1 * NcV;
163 const unsigned int Ncp1 = INT_NCART(Lc+1);
164 const unsigned int Ncp1V = Ncp1 * veclen;
165 const unsigned int am10cp10_offset = iam1 * Ncp1V;
166 const LIBINT2_REALTYPE* src1_ptr = src1 + am10cp10_offset;
171 FOR_CART(cx, cy, cz, Lc)
173 int c[3]; c[0] = cx; c[1] = cy; c[2] = cz;
176 const unsigned int cp1 = INT_CARTINDEX(Lc+1,c[0],c[1]);
177 const unsigned int cp1_offset = cp1 * veclen;
178 const LIBINT2_REALTYPE* sptr = src1_ptr + cp1_offset;
179 const LIBINT2_REALTYPE cxyz = (LIBINT2_REALTYPE)c[xyz];
180 for(
unsigned int v=0; v<veclen; ++v, ++cv) {
181 target[cv] -= inteval->eoz[v] * sptr[v];
183 #if LIBINT2_FLOP_COUNT 184 inteval->nflops[0] += 2 * veclen;
192 const unsigned int Ncm1 = INT_NCART(Lc-1);
193 const unsigned int Ncm1V = Ncm1 * veclen;
194 const unsigned int am10cm10_offset = iam1 * Ncm1V;
195 const LIBINT2_REALTYPE* src3_ptr = src3 + am10cm10_offset;
199 FOR_CART(cx, cy, cz, Lc-1)
201 int c[3]; c[0] = cx; c[1] = cy; c[2] = cz;
204 const unsigned int cc = INT_CARTINDEX(Lc,c[0],c[1]);
205 const unsigned int cc_offset = cc * veclen;
206 LIBINT2_REALTYPE* tptr = target + cc_offset;
207 const LIBINT2_REALTYPE cxyz = (LIBINT2_REALTYPE)c[xyz];
208 for(
unsigned int v=0; v<veclen; ++v) {
209 tptr[v] += cxyz * inteval->oo2z[v] * src3_ptr[v];
211 #if LIBINT2_FLOP_COUNT 212 inteval->nflops[0] += 3 * veclen;
234 template <
int La,
int Lc,
bool InBra,
bool vectorize>
struct ITR_xs_xs<1,La,Lc,InBra,vectorize> {
236 static void compute(
const Libint_t* inteval,
237 LIBINT2_REALTYPE* target,
238 const LIBINT2_REALTYPE* src0,
239 const LIBINT2_REALTYPE* src1,
240 const LIBINT2_REALTYPE* src2,
241 const LIBINT2_REALTYPE* src3) {
244 if (La < 1 || Lc < 2)
247 const unsigned int veclen = vectorize ? inteval->veclen : 1;
249 const unsigned int Na = INT_NCART(La);
250 const unsigned int NaV = Na * veclen;
253 FOR_CART(cx, cy, cz, Lc)
255 int c[3]; c[0] = cx; c[1] = cy; c[2] = cz;
257 enum XYZ {x=0, y=1, z=2};
260 if (cy != 0) xyz = y;
261 if (cx != 0) xyz = x;
265 const LIBINT2_REALTYPE *pfac0;
269 #if LIBINT2_DEFINED(eri,TwoPRepITR_pfac0_1_0_x) 270 inteval->TwoPRepITR_pfac0_1_0_x
275 #if LIBINT2_DEFINED(eri,TwoPRepITR_pfac0_0_1_x) 276 inteval->TwoPRepITR_pfac0_0_1_x;
284 #if LIBINT2_DEFINED(eri,TwoPRepITR_pfac0_1_0_y) 285 inteval->TwoPRepITR_pfac0_1_0_y
290 #if LIBINT2_DEFINED(eri,TwoPRepITR_pfac0_1_1_y) 291 inteval->TwoPRepITR_pfac0_1_1_y;
299 #if LIBINT2_DEFINED(eri,TwoPRepITR_pfac0_1_0_z) 300 inteval->TwoPRepITR_pfac0_1_0_z
305 #if LIBINT2_DEFINED(eri,TwoPRepITR_pfac0_1_1_z) 306 inteval->TwoPRepITR_pfac0_1_1_z;
314 const unsigned int icm1 = INT_CARTINDEX(Lc-1,c[0],c[1]);
315 const unsigned int a0cm10_offset = icm1 * NaV;
316 const LIBINT2_REALTYPE* src0_ptr = src0 + a0cm10_offset;
321 const unsigned int icm2 = INT_CARTINDEX(Lc-2,c[0],c[1]);
322 const unsigned int a0cm20_offset = icm2 * NaV;
324 const LIBINT2_REALTYPE* src2_ptr = src2 + am20c0_offset;
325 const LIBINT2_REALTYPE axyz = (LIBINT2_REALTYPE)c[xyz];
328 for(
unsigned int c = 0; c < Nc; ++c) {
329 for(
unsigned int v=0; v<veclen; ++v, ++cv) {
330 target[cv] = pfac0[v] * src0_ptr[cv] + axyz * inteval->oo2z[v] * src2_ptr[cv];
333 #if LIBINT2_FLOP_COUNT 334 inteval->nflops[0] += 4 * NcV;
340 for(
unsigned int c = 0; c < Nc; ++c) {
341 for(
unsigned int v=0; v<veclen; ++v, ++cv) {
342 target[cv] = pfac0[v] * src0_ptr[cv];
345 #if LIBINT2_FLOP_COUNT 346 inteval->nflops[0] += 1 * NcV;
351 const unsigned int Ncp1 = INT_NCART(Lc+1);
352 const unsigned int Ncp1V = Ncp1 * veclen;
353 const unsigned int am10cp10_offset = iam1 * Ncp1V;
354 const LIBINT2_REALTYPE* src1_ptr = src1 + am10cp10_offset;
359 FOR_CART(cx, cy, cz, Lc)
361 int c[3]; c[0] = cx; c[1] = cy; c[2] = cz;
364 const unsigned int cp1 = INT_CARTINDEX(Lc+1,c[0],c[1]);
365 const unsigned int cp1_offset = cp1 * veclen;
366 const LIBINT2_REALTYPE* sptr = src1_ptr + cp1_offset;
367 const LIBINT2_REALTYPE cxyz = (LIBINT2_REALTYPE)c[xyz];
368 for(
unsigned int v=0; v<veclen; ++v, ++cv) {
369 target[cv] -= inteval->eoz[v] * sptr[v];
371 #if LIBINT2_FLOP_COUNT 372 inteval->nflops[0] += 2 * veclen;
380 const unsigned int Ncm1 = INT_NCART(Lc-1);
381 const unsigned int Ncm1V = Ncm1 * veclen;
382 const unsigned int am10cm10_offset = iam1 * Ncm1V;
383 const LIBINT2_REALTYPE* src3_ptr = src3 + am10cm10_offset;
387 FOR_CART(cx, cy, cz, Lc-1)
389 int c[3]; c[0] = cx; c[1] = cy; c[2] = cz;
392 const unsigned int cc = INT_CARTINDEX(Lc,c[0],c[1]);
393 const unsigned int cc_offset = cc * veclen;
394 LIBINT2_REALTYPE* tptr = target + cc_offset;
395 const LIBINT2_REALTYPE cxyz = (LIBINT2_REALTYPE)c[xyz];
396 for(
unsigned int v=0; v<veclen; ++v) {
397 tptr[v] += cxyz * inteval->oo2z[v] * src3_ptr[v];
399 #if LIBINT2_FLOP_COUNT 400 inteval->nflops[0] += 3 * veclen;
418 #endif // header guard Defaults definitions for various parameters assumed by Libint.
Definition: algebra.cc:24
Definition: ITR_xs_xs.h:31