21 #ifndef _libint2_src_lib_libint_vrrr12kg12xsxs_h_ 22 #define _libint2_src_lib_libint_vrrr12kg12xsxs_h_ 26 #include <util_types.h> 27 #include <libint2/cgshell_ordering.h> 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,
39 const LIBINT2_REALTYPE* src5);
52 template <
int La,
int Lc,
int K,
bool vectorize>
struct VRR_r12kg12_xs_xs<0,La,Lc,K,vectorize> {
54 static void compute(
const Libint_t* inteval,
55 LIBINT2_REALTYPE* target,
56 const LIBINT2_REALTYPE* src0,
57 const LIBINT2_REALTYPE* src1,
58 const LIBINT2_REALTYPE* src2,
59 const LIBINT2_REALTYPE* src3,
60 const LIBINT2_REALTYPE* src4,
61 const LIBINT2_REALTYPE* src5) {
64 if ((La < 2 && Lc < 1) || K < 0)
67 const unsigned int veclen = vectorize ? inteval->veclen : 1;
69 const unsigned int Nc = INT_NCART(Lc);
70 const unsigned int NcV = Nc * veclen;
71 const unsigned int Ncm1 = INT_NCART(Lc-1);
72 const unsigned int Ncm1V = Ncm1 * veclen;
73 const unsigned int Ncp1 = INT_NCART(Lc+1);
74 const unsigned int Ncp1V = Ncp1 * veclen;
77 FOR_CART(ax, ay, az, La)
79 int a[3]; a[0] = ax; a[1] = ay; a[2] = az;
81 enum XYZ {x=0, y=1, z=2};
89 const LIBINT2_REALTYPE *pfac0_0, *pfac4_0;
92 pfac0_0 = inteval->R12kG12_pfac0_0_x;
93 pfac4_0 = inteval->R12kG12_pfac4_0_x;
96 pfac0_0 = inteval->R12kG12_pfac0_0_y;
97 pfac4_0 = inteval->R12kG12_pfac4_0_y;
100 pfac0_0 = inteval->R12kG12_pfac0_0_z;
101 pfac4_0 = inteval->R12kG12_pfac4_0_z;
105 const unsigned int iam1 = INT_CARTINDEX(La-1,a[0],a[1]);
106 const unsigned int am10c0_offset = iam1 * NcV;
107 const LIBINT2_REALTYPE* src0_ptr = src0 + am10c0_offset;
112 const unsigned int iam2 = INT_CARTINDEX(La-2,a[0],a[1]);
113 const unsigned int am20c0_offset = iam2 * NcV;
115 const LIBINT2_REALTYPE* src1_ptr = src1 + 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 target[cv] = pfac0_0[v] * src0_ptr[cv] + axyz * inteval->R12kG12_pfac1_0[v] * src1_ptr[cv];
124 #if LIBINT2_FLOP_COUNT 125 inteval->nflops[0] += 4 * NcV;
131 for(
unsigned int c = 0; c < Nc; ++c) {
132 for(
unsigned int v=0; v<veclen; ++v, ++cv) {
133 target[cv] = pfac0_0[v] * src0_ptr[cv];
136 #if LIBINT2_FLOP_COUNT 137 inteval->nflops[0] += NcV;
142 const unsigned int am10cm10_offset = iam1 * Ncm1V;
143 const LIBINT2_REALTYPE* src2_ptr = src2 + am10cm10_offset;
147 FOR_CART(cx, cy, cz, Lc-1)
149 int c[3]; c[0] = cx; c[1] = cy; c[2] = cz;
152 const unsigned int cc = INT_CARTINDEX(Lc,c[0],c[1]);
153 const unsigned int cc_offset = cc * veclen;
154 LIBINT2_REALTYPE* tptr = target + cc_offset;
155 const LIBINT2_REALTYPE cxyz = (LIBINT2_REALTYPE)c[xyz];
156 for(
unsigned int v=0; v<veclen; ++v) {
157 tptr[v] += cxyz * inteval->R12kG12_pfac2[v] * src2_ptr[v];
159 #if LIBINT2_FLOP_COUNT 160 inteval->nflops[0] += 3 * veclen;
169 const unsigned int ia = INT_CARTINDEX(La,a[0],a[1]);
170 const unsigned int a0c0_offset = ia * NcV;
172 const LIBINT2_REALTYPE* src3_ptr = src3 + a0c0_offset;
173 const LIBINT2_REALTYPE* src5_ptr = src5 + am10c0_offset;
175 for(
unsigned int c = 0; c < Nc; ++c) {
176 for(
unsigned int v=0; v<veclen; ++v, ++cv) {
177 target[cv] += K * inteval->R12kG12_pfac3_0[v] * (src3_ptr[cv] + pfac4_0[v] * src5_ptr[cv]);
180 #if LIBINT2_FLOP_COUNT 181 inteval->nflops[0] += 5 * NcV;
187 const unsigned int am10cp10_offset = iam1 * Ncp1V;
188 const LIBINT2_REALTYPE* src4_ptr0 = src4 + am10cp10_offset;
189 FOR_CART(cx, cy, cz, Lc)
191 int c[3]; c[0] = cx; c[1] = cy; c[2] = cz;
194 const unsigned int cc = INT_CARTINDEX(Lc+1,c[0],c[1]);
195 const unsigned int cc_offset = cc * veclen;
196 const LIBINT2_REALTYPE* src4_ptr = src4_ptr0 + cc_offset;
197 for(
unsigned int v=0; v<veclen; ++v, ++cv) {
198 target[cv] -= K * inteval->R12kG12_pfac3_0[v] * src4_ptr[v];
200 #if LIBINT2_FLOP_COUNT 201 inteval->nflops[0] += 3 * veclen;
221 #endif // header guard 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, const LIBINT2_REALTYPE *src5)
Definition: VRR_r12kg12_xs_xs.h:54
Definition: VRR_r12kg12_xs_xs.h:31
Defaults definitions for various parameters assumed by Libint.
Definition: algebra.cc:24