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 // Ye Luo, yeluo@anl.gov, Argonne National Laboratory 10 // 11 // File created by: Ken Esler, kpesler@gmail.com, University of Illinois at Urbana-Champaign 12 ////////////////////////////////////////////////////////////////////////////////////// 13 14 15 #ifndef BSPLINE_JASTROW_CUDA_PBC_H 16 #define BSPLINE_JASTROW_CUDA_PBC_H 17 18 #include <complex> 19 #include "NLjobGPU.h" 20 21 /////////////////////// 22 // Two-Body routines // 23 /////////////////////// 24 25 void two_body_sum_PBC(float* R[], 26 int e1_first, 27 int e1_last, 28 int e2_first, 29 int e2_last, 30 float spline_coefs[], 31 int numCoefs, 32 float rMax, 33 float lattice[], 34 float latticeInv[], 35 float sum[], 36 int numWalkers); 37 38 void two_body_sum_PBC(double* R[], 39 int e1_first, 40 int e1_last, 41 int e2_first, 42 int e2_last, 43 double spline_coefs[], 44 int numCoefs, 45 double rMax, 46 double lattice[], 47 double latticeInv[], 48 double sum[], 49 int numWalkers); 50 51 void two_body_ratio_PBC(float* R[], 52 int first, 53 int last, 54 float Rnew[], 55 int inew, 56 int offset, 57 float spline_coefs[], 58 int numCoefs, 59 float rMax, 60 float lattice[], 61 float latticeInv[], 62 float sum[], 63 int numWalkers); 64 65 void two_body_ratio_PBC(double* R[], 66 int first, 67 int last, 68 double Rnew[], 69 int inew, 70 int offset, 71 double spline_coefs[], 72 int numCoefs, 73 double rMax, 74 double lattice[], 75 double latticeInv[], 76 double sum[], 77 int numWalkers); 78 79 void two_body_ratio_grad_PBC(float* R[], 80 int first, 81 int last, 82 float Rnew[], 83 int inew, 84 int offset, 85 float spline_coefs[], 86 int numCoefs, 87 float rMax, 88 float lattice[], 89 float latticeInv[], 90 bool zero, 91 float ratio_grad[], 92 int numWalkers, 93 bool use_fast_image); 94 95 void two_body_ratio_grad_PBC(double* R[], 96 int first, 97 int last, 98 double Rnew[], 99 int inew, 100 int offset, 101 double spline_coefs[], 102 int numCoefs, 103 double rMax, 104 double lattice[], 105 double latticeInv[], 106 bool zero, 107 double ratio_grad[], 108 int numWalkers, 109 bool use_fast_image); 110 111 void two_body_NLratios_PBC(NLjobGPU<float> jobs[], 112 int first, 113 int last, 114 float* spline_coefs[], 115 int numCoefs[], 116 float rMax[], 117 float lattice[], 118 float latticeInv[], 119 float sim_cell_radius, 120 int numjobs); 121 122 void two_body_NLratios_PBC(NLjobGPU<double> jobs[], 123 int first, 124 int last, 125 double* spline_coefs[], 126 int numCoefs[], 127 double rMax[], 128 double lattice[], 129 double latticeInv[], 130 double sim_cell_radius, 131 int numjobs); 132 133 134 void two_body_update(float* R[], int N, int iat, int numWalkers); 135 136 void two_body_update(double* R[], int N, int iat, int numWalkers); 137 138 139 void two_body_grad_lapl_PBC(float* R[], 140 int e1_first, 141 int e1_last, 142 int e2_first, 143 int e2_last, 144 float spline_coefs[], 145 int numCoefs, 146 float rMax, 147 float lattice[], 148 float latticeInv[], 149 float sim_cell_radius, 150 float gradLapl[], 151 int row_stride, 152 int numWalkers); 153 154 void two_body_grad_lapl_PBC(double* R[], 155 int e1_first, 156 int e1_last, 157 int e2_first, 158 int e2_last, 159 double spline_coefs[], 160 int numCoefs, 161 double rMax, 162 double lattice[], 163 double latticeInv[], 164 double sim_cell_radius, 165 double gradLapl[], 166 int row_stride, 167 int numWalkers); 168 169 170 void two_body_gradient_PBC(float* R[], 171 int first, 172 int last, 173 int iat, 174 float spline_coefs[], 175 int numCoefs, 176 float rMax, 177 float lattice[], 178 float latticeInv[], 179 float sim_cell_radius, 180 bool zeroOut, 181 float grad[], 182 int numWalkers); 183 184 void two_body_gradient_PBC(double* R[], 185 int first, 186 int last, 187 int iat, 188 double spline_coefs[], 189 int numCoefs, 190 double rMax, 191 double lattice[], 192 double latticeInv[], 193 double sim_cell_radius, 194 bool zeroOut, 195 double grad[], 196 int numWalkers); 197 198 void two_body_derivs_PBC(float* R[], 199 float* gradLogPsi[], 200 int e1_first, 201 int e1_last, 202 int e2_first, 203 int e2_last, 204 int numCoefs, 205 float rMax, 206 float lattice[], 207 float latticeInv[], 208 float sim_cell_radius, 209 float* derivs[], 210 int numWalkers); 211 void two_body_derivs_PBC(double* R[], 212 double* gradLogPsi[], 213 int e1_first, 214 int e1_last, 215 int e2_first, 216 int e2_last, 217 int numCoefs, 218 double rMax, 219 double lattice[], 220 double latticeInv[], 221 double sim_cell_radius, 222 double* derivs[], 223 int numWalkers); 224 225 226 #ifdef QMC_COMPLEX 227 void two_body_derivs_PBC(float* R[], 228 std::complex<float>* gradLogPsi[], 229 int e1_first, 230 int e1_last, 231 int e2_first, 232 int e2_last, 233 int numCoefs, 234 float rMax, 235 float lattice[], 236 float latticeInv[], 237 float sim_cell_radius, 238 float* derivs[], 239 int numWalkers); 240 void two_body_derivs_PBC(double* R[], 241 std::complex<double>* gradLogPsi[], 242 int e1_first, 243 int e1_last, 244 int e2_first, 245 int e2_last, 246 int numCoefs, 247 double rMax, 248 double lattice[], 249 double latticeInv[], 250 double sim_cell_radius, 251 double* derivs[], 252 int numWalkers); 253 #endif 254 255 256 /////////////////////// 257 // One-Body routines // 258 /////////////////////// 259 260 void one_body_sum_PBC(float C[], 261 float* R[], 262 int e1_first, 263 int e1_last, 264 int e2_first, 265 int e2_last, 266 float spline_coefs[], 267 int numCoefs, 268 float rMax, 269 float lattice[], 270 float latticeInv[], 271 float sum[], 272 int numWalkers); 273 274 void one_body_sum_PBC(double C[], 275 double* R[], 276 int e1_first, 277 int e1_last, 278 int e2_first, 279 int e2_last, 280 double spline_coefs[], 281 int numCoefs, 282 double rMax, 283 double lattice[], 284 double latticeInv[], 285 double sum[], 286 int numWalkers); 287 288 void one_body_ratio_PBC(float C[], 289 float* R[], 290 int first, 291 int last, 292 float Rnew[], 293 int inew, 294 float spline_coefs[], 295 int numCoefs, 296 int nw, 297 float rMax, 298 float lattice[], 299 float latticeInv[], 300 float sum[], 301 int numWalkers); 302 303 void one_body_ratio_PBC(double C[], 304 double* R[], 305 int first, 306 int last, 307 double Rnew[], 308 int inew, 309 double spline_coefs[], 310 int numCoefs, 311 int nw, 312 double rMax, 313 double lattice[], 314 double latticeInv[], 315 double sum[], 316 int numWalkers); 317 318 void one_body_ratio_grad_PBC(float C[], 319 float* R[], 320 int first, 321 int last, 322 float Rnew[], 323 int inew, 324 float spline_coefs[], 325 int numCoefs, 326 int nw, 327 float rMax, 328 float lattice[], 329 float latticeInv[], 330 bool zero, 331 float ratio_grad[], 332 int numWalkers, 333 bool use_fast_image); 334 void one_body_ratio_grad_PBC(double C[], 335 double* R[], 336 int first, 337 int last, 338 double Rnew[], 339 int inew, 340 double spline_coefs[], 341 int numCoefs, 342 int nw, 343 double rMax, 344 double lattice[], 345 double latticeInv[], 346 bool zero, 347 double ratio_grad[], 348 int numWalkers, 349 bool use_fast_image); 350 351 void one_body_NLratios_PBC(NLjobGPU<float> jobs[], 352 float C[], 353 int first, 354 int last, 355 float spline_coefs[], 356 int numCoefs, 357 float rMax, 358 float lattice[], 359 float latticeInv[], 360 int numjobs); 361 362 void one_body_NLratios_PBC(NLjobGPU<float> jobs[], 363 float C[], 364 int first, 365 int last, 366 float spline_coefs[], 367 int numCoefs, 368 float rMax, 369 float lattice[], 370 float latticeInv[], 371 float sim_cell_radius, 372 int numjobs); 373 374 375 void one_body_NLratios_PBC(NLjobGPU<double> jobs[], 376 double C[], 377 int first, 378 int last, 379 double spline_coefs[], 380 int numCoefs, 381 double rMax, 382 double lattice[], 383 double latticeInv[], 384 double sim_cell_radius, 385 int numjobs); 386 387 void one_body_update(float* R[], int N, int iat, int numWalkers); 388 389 void one_body_update(double* R[], int N, int iat, int numWalkers); 390 391 392 void one_body_grad_lapl_PBC(float C[], 393 float* R[], 394 int e1_first, 395 int e1_last, 396 int e2_first, 397 int e2_last, 398 float spline_coefs[], 399 int numCoefs, 400 float rMax, 401 float lattice[], 402 float latticeInv[], 403 float gradLapl[], 404 int row_stride, 405 int numWalkers); 406 407 void one_body_grad_lapl_PBC(double C[], 408 double* R[], 409 int e1_first, 410 int e1_last, 411 int e2_first, 412 int e2_last, 413 double spline_coefs[], 414 int numCoefs, 415 double rMax, 416 double lattice[], 417 double latticeInv[], 418 double gradLapl[], 419 int row_stride, 420 int numWalkers); 421 422 void one_body_gradient_PBC(float* Rlist[], 423 int iat, 424 float C[], 425 int first, 426 int last, 427 float spline_coefs[], 428 int num_coefs, 429 float rMax, 430 float L[], 431 float Linv[], 432 bool zeroSum, 433 float grad[], 434 int numWalkers); 435 436 void one_body_gradient_PBC(double* Rlist[], 437 int iat, 438 double C[], 439 int first, 440 int last, 441 double spline_coefs[], 442 int num_coefs, 443 double rMax, 444 double L[], 445 double Linv[], 446 bool zeroSum, 447 double grad[], 448 int numWalkers); 449 450 451 void one_body_derivs_PBC(float C[], 452 float* R[], 453 float* gradLogPsi[], 454 int cfirst, 455 int clast, 456 int efirst, 457 int elast, 458 int numCoefs, 459 float rMax, 460 float lattice[], 461 float latticeInv[], 462 float sim_cell_radius, 463 float* derivs[], 464 int numWalkers); 465 466 void one_body_derivs_PBC(double C[], 467 double* R[], 468 double* gradLogPsi[], 469 int cfirst, 470 int clast, 471 int efirst, 472 int elast, 473 int numCoefs, 474 double rMax, 475 double lattice[], 476 double latticeInv[], 477 double sim_cell_radius, 478 double* derivs[], 479 int numWalkers); 480 481 482 #ifdef QMC_COMPLEX 483 484 void one_body_derivs_PBC(float C[], 485 float* R[], 486 std::complex<float>* gradLogPsi[], 487 int cfirst, 488 int clast, 489 int efirst, 490 int elast, 491 int numCoefs, 492 float rMax, 493 float lattice[], 494 float latticeInv[], 495 float sim_cell_radius, 496 float* derivs[], 497 int numWalkers); 498 499 void one_body_derivs_PBC(double C[], 500 double* R[], 501 std::complex<double>* gradLogPsi[], 502 int cfirst, 503 int clast, 504 int efirst, 505 int elast, 506 int numCoefs, 507 double rMax, 508 double lattice[], 509 double latticeInv[], 510 double sim_cell_radius, 511 double* derivs[], 512 int numWalkers); 513 514 #endif 515 516 #endif 517