19 #ifndef _libint2_src_lib_libint_vrrr12kg12xsxs_h_ 20 #define _libint2_src_lib_libint_vrrr12kg12xsxs_h_ 24 #include <util_types.h> 25 #include <libint2/cgshell_ordering.h> 30 static void compute(
const Libint_t* inteval,
31 LIBINT2_REALTYPE* target,
32 const LIBINT2_REALTYPE* src0,
33 const LIBINT2_REALTYPE* src1,
34 const LIBINT2_REALTYPE* src2,
35 const LIBINT2_REALTYPE* src3,
36 const LIBINT2_REALTYPE* src4,
37 const LIBINT2_REALTYPE* src5);
50 template <
int La,
int Lc,
int K,
bool vectorize>
struct VRR_r12kg12_xs_xs<0,La,Lc,K,vectorize> {
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,
59 const LIBINT2_REALTYPE* src5) {
62 if ((La < 2 && Lc < 1) || K < 0)
65 const unsigned int veclen = vectorize ? inteval->veclen : 1;
67 const unsigned int Nc = INT_NCART(Lc);
68 const unsigned int NcV = Nc * veclen;
69 const unsigned int Ncm1 = INT_NCART(Lc-1);
70 const unsigned int Ncm1V = Ncm1 * veclen;
71 const unsigned int Ncp1 = INT_NCART(Lc+1);
72 const unsigned int Ncp1V = Ncp1 * veclen;
75 FOR_CART(ax, ay, az, La)
77 int a[3]; a[0] = ax; a[1] = ay; a[2] = az;
79 enum XYZ {x=0, y=1, z=2};
87 const LIBINT2_REALTYPE *pfac0_0, *pfac4_0;
90 pfac0_0 = inteval->R12kG12_pfac0_0_x;
91 pfac4_0 = inteval->R12kG12_pfac4_0_x;
94 pfac0_0 = inteval->R12kG12_pfac0_0_y;
95 pfac4_0 = inteval->R12kG12_pfac4_0_y;
98 pfac0_0 = inteval->R12kG12_pfac0_0_z;
99 pfac4_0 = inteval->R12kG12_pfac4_0_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 = src0 + am10c0_offset;
110 const unsigned int iam2 = INT_CARTINDEX(La-2,a[0],a[1]);
111 const unsigned int am20c0_offset = iam2 * NcV;
113 const LIBINT2_REALTYPE* src1_ptr = src1 + am20c0_offset;
114 const LIBINT2_REALTYPE axyz = (LIBINT2_REALTYPE)a[xyz];
117 for(
unsigned int c = 0; c < Nc; ++c) {
118 for(
unsigned int v=0; v<veclen; ++v, ++cv) {
119 target[cv] = pfac0_0[v] * src0_ptr[cv] + axyz * inteval->R12kG12_pfac1_0[v] * src1_ptr[cv];
122 #if LIBINT2_FLOP_COUNT 123 inteval->nflops[0] += 4 * NcV;
129 for(
unsigned int c = 0; c < Nc; ++c) {
130 for(
unsigned int v=0; v<veclen; ++v, ++cv) {
131 target[cv] = pfac0_0[v] * src0_ptr[cv];
134 #if LIBINT2_FLOP_COUNT 135 inteval->nflops[0] += NcV;
140 const unsigned int am10cm10_offset = iam1 * Ncm1V;
141 const LIBINT2_REALTYPE* src2_ptr = src2 + am10cm10_offset;
145 FOR_CART(cx, cy, cz, Lc-1)
147 int c[3]; c[0] = cx; c[1] = cy; c[2] = cz;
150 const unsigned int cc = INT_CARTINDEX(Lc,c[0],c[1]);
151 const unsigned int cc_offset = cc * veclen;
152 LIBINT2_REALTYPE* tptr = target + cc_offset;
153 const LIBINT2_REALTYPE cxyz = (LIBINT2_REALTYPE)c[xyz];
154 for(
unsigned int v=0; v<veclen; ++v) {
155 tptr[v] += cxyz * inteval->R12kG12_pfac2[v] * src2_ptr[v];
157 #if LIBINT2_FLOP_COUNT 158 inteval->nflops[0] += 3 * veclen;
167 const unsigned int ia = INT_CARTINDEX(La,a[0],a[1]);
168 const unsigned int a0c0_offset = ia * NcV;
170 const LIBINT2_REALTYPE* src3_ptr = src3 + a0c0_offset;
171 const LIBINT2_REALTYPE* src5_ptr = src5 + am10c0_offset;
173 for(
unsigned int c = 0; c < Nc; ++c) {
174 for(
unsigned int v=0; v<veclen; ++v, ++cv) {
175 target[cv] += K * inteval->R12kG12_pfac3_0[v] * (src3_ptr[cv] + pfac4_0[v] * src5_ptr[cv]);
178 #if LIBINT2_FLOP_COUNT 179 inteval->nflops[0] += 5 * NcV;
185 const unsigned int am10cp10_offset = iam1 * Ncp1V;
186 const LIBINT2_REALTYPE* src4_ptr0 = src4 + am10cp10_offset;
187 FOR_CART(cx, cy, cz, Lc)
189 int c[3]; c[0] = cx; c[1] = cy; c[2] = cz;
192 const unsigned int cc = INT_CARTINDEX(Lc+1,c[0],c[1]);
193 const unsigned int cc_offset = cc * veclen;
194 const LIBINT2_REALTYPE* src4_ptr = src4_ptr0 + cc_offset;
195 for(
unsigned int v=0; v<veclen; ++v, ++cv) {
196 target[cv] -= K * inteval->R12kG12_pfac3_0[v] * src4_ptr[v];
198 #if LIBINT2_FLOP_COUNT 199 inteval->nflops[0] += 3 * veclen;
219 #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:52
Definition: VRR_r12kg12_xs_xs.h:29
Defaults definitions for various parameters assumed by Libint.
Definition: algebra.cc:23
Definition: test_eri_rys.cc:46