19 #ifndef _libint2_src_lib_libint_osvrrxsxs_h_ 20 #define _libint2_src_lib_libint_osvrrxsxs_h_ 24 #include <util_types.h> 25 #include <libint2/cgshell_ordering.h> 29 template <
int part,
int La,
int Lc,
bool unit_b,
bool vectorize>
struct OSVRR_xs_xs {
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);
46 template <
int La,
int Lc,
48 bool vectorize>
struct OSVRR_xs_xs<0,La,Lc,unit_b,vectorize> {
51 LIBINT2_REALTYPE* target,
52 const LIBINT2_REALTYPE* src0,
53 const LIBINT2_REALTYPE* src1,
54 const LIBINT2_REALTYPE* src2,
55 const LIBINT2_REALTYPE* src3,
56 const LIBINT2_REALTYPE* src4) {
59 assert(not (La < 2 || Lc < 1));
61 const unsigned int veclen = vectorize ? inteval->veclen : 1;
63 const unsigned int Nc = INT_NCART(Lc);
64 const unsigned int NcV = Nc * veclen;
67 FOR_CART(ax, ay, az, La)
69 int a[3]; a[0] = ax; a[1] = ay; a[2] = az;
71 enum XYZ {x=0, y=1, z=2};
79 const LIBINT2_REALTYPE *PA, *WP;
82 #if LIBINT2_DEFINED(eri,PA_x) 83 if (not unit_b) PA = inteval->PA_x;
88 #if LIBINT2_DEFINED(eri,PA_y) 89 if (not unit_b) PA = inteval->PA_y;
94 #if LIBINT2_DEFINED(eri,PA_z) 95 if (not unit_b) PA = inteval->PA_z;
101 const unsigned int iam1 = INT_CARTINDEX(La-1,a[0],a[1]);
102 const unsigned int am10c0_offset = iam1 * NcV;
103 const LIBINT2_REALTYPE* src0_ptr = unit_b ? 0 : src0 + am10c0_offset;
104 const LIBINT2_REALTYPE* src1_ptr = src1 + am10c0_offset;
109 const unsigned int iam2 = INT_CARTINDEX(La-2,a[0],a[1]);
110 const unsigned int am20c0_offset = iam2 * NcV;
112 const LIBINT2_REALTYPE* src2_ptr = src2 + am20c0_offset;
113 const LIBINT2_REALTYPE* src3_ptr = src3 + 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 LIBINT2_REALTYPE value = WP[v] * src1_ptr[cv] + axyz * inteval->oo2z[v] * (src2_ptr[cv] - inteval->roz[v] * src3_ptr[cv]);
120 if (not unit_b) value += PA[v] * src0_ptr[cv];
124 #if LIBINT2_FLOP_COUNT 125 inteval->nflops[0] += (unit_b ? 6 : 8) * NcV;
131 for(
unsigned int c = 0; c < Nc; ++c) {
132 for(
unsigned int v=0; v<veclen; ++v, ++cv) {
133 LIBINT2_REALTYPE value = WP[v] * src1_ptr[cv];
134 if (not unit_b) value += PA[v] * src0_ptr[cv];
138 #if LIBINT2_FLOP_COUNT 139 inteval->nflops[0] += (unit_b ? 1 : 3) * NcV;
144 const unsigned int Ncm1 = INT_NCART(Lc-1);
145 const unsigned int Ncm1V = Ncm1 * veclen;
146 const unsigned int am10cm10_offset = iam1 * Ncm1V;
147 const LIBINT2_REALTYPE* src4_ptr = src4 + am10cm10_offset;
151 FOR_CART(cx, cy, cz, Lc-1)
153 int c[3]; c[0] = cx; c[1] = cy; c[2] = cz;
156 const unsigned int cc = INT_CARTINDEX(Lc,c[0],c[1]);
157 const unsigned int cc_offset = cc * veclen;
158 LIBINT2_REALTYPE* tptr = target + cc_offset;
159 const LIBINT2_REALTYPE cxyz = (LIBINT2_REALTYPE)c[xyz];
160 for(
unsigned int v=0; v<veclen; ++v) {
161 tptr[v] += cxyz * inteval->oo2ze[v] * src4_ptr[v];
163 #if LIBINT2_FLOP_COUNT 164 inteval->nflops[0] += 3 * veclen;
183 template <
int part,
int La,
int Lc,
bool vectorize>
struct OSAVRR_xs_xs {
184 static void compute(
const Libint_t* inteval,
185 LIBINT2_REALTYPE* target,
186 const LIBINT2_REALTYPE* src1,
187 const LIBINT2_REALTYPE* src4);
194 template <
int La,
int Lc,
bool vectorize>
struct OSAVRR_xs_xs<0,La,Lc,vectorize> {
197 LIBINT2_REALTYPE* target,
198 const LIBINT2_REALTYPE* src1,
199 const LIBINT2_REALTYPE* src4) {
202 assert(not (La < 1 || Lc < 1));
204 const unsigned int veclen = vectorize ? inteval->veclen : 1;
206 const unsigned int Nc = INT_NCART(Lc);
207 const unsigned int NcV = Nc * veclen;
210 FOR_CART(ax, ay, az, La)
212 int a[3]; a[0] = ax; a[1] = ay; a[2] = az;
214 enum XYZ {x=0, y=1, z=2};
217 if (ay != 0) xyz = y;
218 if (ax != 0) xyz = x;
222 const LIBINT2_REALTYPE *WP;
235 const unsigned int iam1 = INT_CARTINDEX(La-1,a[0],a[1]);
236 const unsigned int am10c0_offset = iam1 * NcV;
237 const LIBINT2_REALTYPE* src1_ptr = src1 + am10c0_offset;
241 for(
unsigned int c = 0; c < Nc; ++c) {
242 for(
unsigned int v=0; v<veclen; ++v, ++cv) {
243 target[cv] = WP[v] * src1_ptr[cv];
246 #if LIBINT2_FLOP_COUNT 247 inteval->nflops[0] += NcV;
252 const unsigned int Ncm1 = INT_NCART(Lc-1);
253 const unsigned int Ncm1V = Ncm1 * veclen;
254 const unsigned int am10cm10_offset = iam1 * Ncm1V;
255 const LIBINT2_REALTYPE* src4_ptr = src4 + am10cm10_offset;
259 FOR_CART(cx, cy, cz, Lc-1)
261 int c[3]; c[0] = cx; c[1] = cy; c[2] = cz;
264 const unsigned int cc = INT_CARTINDEX(Lc,c[0],c[1]);
265 const unsigned int cc_offset = cc * veclen;
266 LIBINT2_REALTYPE* tptr = target + cc_offset;
267 const LIBINT2_REALTYPE cxyz = (LIBINT2_REALTYPE)c[xyz];
268 for(
unsigned int v=0; v<veclen; ++v) {
269 tptr[v] += cxyz * inteval->oo2ze[v] * src4_ptr[v];
271 #if LIBINT2_FLOP_COUNT 272 inteval->nflops[0] += 3 * veclen;
292 #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:196
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:50
Definition: OSVRR_xs_xs.h:183
Defaults definitions for various parameters assumed by Libint.
Definition: algebra.cc:23
Definition: test_eri_rys.cc:46
Definition: OSVRR_xs_xs.h:29