1 ////////////////////////////////////////////////////////////////////////////////////// 2 // This file is distributed under the University of Illinois/NCSA Open Source License. 3 // See LICENSE file in top directory for details. 4 // 5 // Copyright (c) 2016 Jeongnim Kim and QMCPACK developers. 6 // 7 // File developed by: Ken Esler, kpesler@gmail.com, University of Illinois at Urbana-Champaign 8 // Jeremy McMinnis, jmcminis@gmail.com, University of Illinois at Urbana-Champaign 9 // 10 // File created by: Ken Esler, kpesler@gmail.com, University of Illinois at Urbana-Champaign 11 ////////////////////////////////////////////////////////////////////////////////////// 12 13 14 #ifndef BSPLINE_JASTROW_CUDA_H 15 #define BSPLINE_JASTROW_CUDA_H 16 17 #include <complex> 18 #include "NLjobGPU.h" 19 20 /////////////////////// 21 // Two-Body routines // 22 /////////////////////// 23 24 void two_body_sum(float* R[], 25 int e1_first, 26 int e1_last, 27 int e2_first, 28 int e2_last, 29 float spline_coefs[], 30 int numCoefs, 31 float rMax, 32 float sum[], 33 int numWalkers); 34 35 void two_body_sum(double* R[], 36 int e1_first, 37 int e1_last, 38 int e2_first, 39 int e2_last, 40 double spline_coefs[], 41 int numCoefs, 42 double rMax, 43 double sum[], 44 int numWalkers); 45 46 void two_body_ratio(float* R[], 47 int first, 48 int last, 49 float Rnew[], 50 int inew, 51 int offset, 52 float spline_coefs[], 53 int numCoefs, 54 float rMax, 55 float sum[], 56 int numWalkers); 57 58 void two_body_ratio(double* R[], 59 int first, 60 int last, 61 double Rnew[], 62 int inew, 63 int offset, 64 double spline_coefs[], 65 int numCoefs, 66 double rMax, 67 double sum[], 68 int numWalkers); 69 70 void two_body_ratio_grad(float* R[], 71 int first, 72 int last, 73 float Rnew[], 74 int inew, 75 int offset, 76 float spline_coefs[], 77 int numCoefs, 78 float rMax, 79 bool zero, 80 float ratio_grad[], 81 int numWalkers); 82 83 void two_body_ratio_grad(double* R[], 84 int first, 85 int last, 86 double Rnew[], 87 int inew, 88 int offset, 89 double spline_coefs[], 90 int numCoefs, 91 double rMax, 92 bool zero, 93 double ratio_grad[], 94 int numWalkers); 95 96 void two_body_NLratios(NLjobGPU<float> jobs[], 97 int first, 98 int last, 99 float* spline_coefs[], 100 int numCoefs[], 101 float rMax[], 102 int numjobs); 103 104 void two_body_NLratios(NLjobGPU<double> jobs[], 105 int first, 106 int last, 107 double* spline_coefs[], 108 int numCoefs[], 109 double rMax[], 110 int numjobs); 111 112 113 void two_body_update(float* R[], int N, int iat, int numWalkers); 114 115 void two_body_update(double* R[], int N, int iat, int numWalkers); 116 117 118 void two_body_grad_lapl(float* R[], 119 int e1_first, 120 int e1_last, 121 int e2_first, 122 int e2_last, 123 float spline_coefs[], 124 int numCoefs, 125 float rMax, 126 float gradLapl[], 127 int row_stride, 128 int numWalkers); 129 130 void two_body_grad_lapl(double* R[], 131 int e1_first, 132 int e1_last, 133 int e2_first, 134 int e2_last, 135 double spline_coefs[], 136 int numCoefs, 137 double rMax, 138 double gradLapl[], 139 int row_stride, 140 int numWalkers); 141 142 143 void two_body_gradient(float* R[], 144 int first, 145 int last, 146 int iat, 147 float spline_coefs[], 148 int numCoefs, 149 float rMax, 150 bool zeroOut, 151 float grad[], 152 int numWalkers); 153 154 void two_body_gradient(double* R[], 155 int first, 156 int last, 157 int iat, 158 double spline_coefs[], 159 int numCoefs, 160 double rMax, 161 bool zeroOut, 162 double grad[], 163 int numWalkers); 164 165 void two_body_derivs(float* R[], 166 float* gradLogPsi[], 167 int e1_first, 168 int e1_last, 169 int e2_first, 170 int e2_last, 171 int numCoefs, 172 float rMax, 173 float* derivs[], 174 int numWalkers); 175 void two_body_derivs(double* R[], 176 double* gradLogPsi[], 177 int e1_first, 178 int e1_last, 179 int e2_first, 180 int e2_last, 181 int numCoefs, 182 double rMax, 183 double* derivs[], 184 int numWalkers); 185 186 187 #ifdef QMC_COMPLEX 188 void two_body_derivs(float* R[], 189 std::complex<float>* gradLogPsi[], 190 int e1_first, 191 int e1_last, 192 int e2_first, 193 int e2_last, 194 int numCoefs, 195 float rMax, 196 float* derivs[], 197 int numWalkers); 198 void two_body_derivs(double* R[], 199 std::complex<double>* gradLogPsi[], 200 int e1_first, 201 int e1_last, 202 int e2_first, 203 int e2_last, 204 int numCoefs, 205 double rMax, 206 double* derivs[], 207 int numWalkers); 208 #endif 209 210 /////////////////////// 211 // One-Body routines // 212 /////////////////////// 213 214 void one_body_sum(float C[], 215 float* R[], 216 int e1_first, 217 int e1_last, 218 int e2_first, 219 int e2_last, 220 float spline_coefs[], 221 int numCoefs, 222 float rMax, 223 float sum[], 224 int numWalkers); 225 226 void one_body_sum(double C[], 227 double* R[], 228 int e1_first, 229 int e1_last, 230 int e2_first, 231 int e2_last, 232 double spline_coefs[], 233 int numCoefs, 234 double rMax, 235 double sum[], 236 int numWalkers); 237 238 void one_body_ratio(float C[], 239 float* R[], 240 int first, 241 int last, 242 float Rnew[], 243 int inew, 244 float spline_coefs[], 245 int numCoefs, 246 int nw, 247 float rMax, 248 float sum[], 249 int numWalkers); 250 251 void one_body_ratio(double C[], 252 double* R[], 253 int first, 254 int last, 255 double Rnew[], 256 int inew, 257 double spline_coefs[], 258 int numCoefs, 259 int nw, 260 double rMax, 261 double sum[], 262 int numWalkers); 263 264 void one_body_ratio_grad(float C[], 265 float* R[], 266 int first, 267 int last, 268 float Rnew[], 269 int inew, 270 float spline_coefs[], 271 int numCoefs, 272 int nw, 273 float rMax, 274 bool zero, 275 float ratio_grad[], 276 int numWalkers); 277 void one_body_ratio_grad(double C[], 278 double* R[], 279 int first, 280 int last, 281 double Rnew[], 282 int inew, 283 double spline_coefs[], 284 int numCoefs, 285 int nw, 286 double rMax, 287 bool zero, 288 double ratio_grad[], 289 int numWalkers); 290 291 void one_body_NLratios(NLjobGPU<float> jobs[], 292 float C[], 293 int first, 294 int last, 295 float spline_coefs[], 296 int numCoefs, 297 float rMax, 298 int numjobs); 299 300 void one_body_NLratios(NLjobGPU<float> jobs[], 301 float C[], 302 int first, 303 int last, 304 float spline_coefs[], 305 int numCoefs, 306 float rMax, 307 int numjobs); 308 309 310 void one_body_NLratios(NLjobGPU<double> jobs[], 311 double C[], 312 int first, 313 int last, 314 double spline_coefs[], 315 int numCoefs, 316 double rMax, 317 int numjobs); 318 319 void one_body_update(float* R[], int N, int iat, int numWalkers); 320 321 void one_body_update(double* R[], int N, int iat, int numWalkers); 322 323 324 void one_body_grad_lapl(float C[], 325 float* R[], 326 int e1_first, 327 int e1_last, 328 int e2_first, 329 int e2_last, 330 float spline_coefs[], 331 int numCoefs, 332 float rMax, 333 float gradLapl[], 334 int row_stride, 335 int numWalkers); 336 337 void one_body_grad_lapl(double C[], 338 double* R[], 339 int e1_first, 340 int e1_last, 341 int e2_first, 342 int e2_last, 343 double spline_coefs[], 344 int numCoefs, 345 double rMax, 346 double gradLapl[], 347 int row_stride, 348 int numWalkers); 349 350 void one_body_gradient(float* Rlist[], 351 int iat, 352 float C[], 353 int first, 354 int last, 355 float spline_coefs[], 356 int num_coefs, 357 float rMax, 358 bool zeroSum, 359 float grad[], 360 int numWalkers); 361 362 void one_body_gradient(double* Rlist[], 363 int iat, 364 double C[], 365 int first, 366 int last, 367 double spline_coefs[], 368 int num_coefs, 369 double rMax, 370 bool zeroSum, 371 double grad[], 372 int numWalkers); 373 374 375 void one_body_derivs(float C[], 376 float* R[], 377 float* gradLogPsi[], 378 int cfirst, 379 int clast, 380 int efirst, 381 int elast, 382 int numCoefs, 383 float rMax, 384 float* derivs[], 385 int numWalkers); 386 387 void one_body_derivs(double C[], 388 double* R[], 389 double* gradLogPsi[], 390 int cfirst, 391 int clast, 392 int efirst, 393 int elast, 394 int numCoefs, 395 double rMax, 396 double* derivs[], 397 int numWalkers); 398 399 400 #ifdef QMC_COMPLEX 401 void one_body_derivs(float C[], 402 float* R[], 403 std::complex<float>* gradLogPsi[], 404 int cfirst, 405 int clast, 406 int efirst, 407 int elast, 408 int numCoefs, 409 float rMax, 410 float* derivs[], 411 int numWalkers); 412 413 void one_body_derivs(double C[], 414 double* R[], 415 std::complex<double>* gradLogPsi[], 416 int cfirst, 417 int clast, 418 int efirst, 419 int elast, 420 int numCoefs, 421 double rMax, 422 double* derivs[], 423 int numWalkers); 424 425 #endif 426 427 #endif 428