Commit c63f50c
dyzheng
fix: auto-load k-point to GPU in PAGED_GPU fix_k/fix_b/fix_kb
When device_memory_mode defaults to 'paged' (auto mode on GPU PW),
fix_k() returned CPU buffer pointer for k-points not yet loaded,
causing psiToRho and other GPU consumers to read CPU memory instead
of GPU memory. This produced wrong charge density and incorrect total
energy for multi-k-point GPU tests (003, 078, etc.).
Fix: make current_k_gpu_ mutable, call load_k_to_gpu in fix_k/fix_b/
fix_kb when the requested k-point differs from the loaded one. Non-PAGED
modes are unaffected (load_k_to_gpu is a no-op for ALL_GPU).1 parent 7f107b3 commit c63f50c
2 files changed
Lines changed: 20 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
536 | 536 | | |
537 | 537 | | |
538 | 538 | | |
539 | | - | |
| 539 | + | |
540 | 540 | | |
541 | | - | |
542 | | - | |
| 541 | + | |
543 | 542 | | |
544 | 543 | | |
545 | 544 | | |
546 | | - | |
547 | | - | |
548 | | - | |
| 545 | + | |
549 | 546 | | |
550 | 547 | | |
551 | 548 | | |
| |||
572 | 569 | | |
573 | 570 | | |
574 | 571 | | |
575 | | - | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
576 | 580 | | |
577 | 581 | | |
578 | 582 | | |
| |||
604 | 608 | | |
605 | 609 | | |
606 | 610 | | |
607 | | - | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
608 | 619 | | |
609 | 620 | | |
610 | 621 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | | - | |
| 193 | + | |
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| |||
0 commit comments