Skip to content

Commit

Permalink
Merge branch 'develop' into rename-type
Browse files Browse the repository at this point in the history
  • Loading branch information
ye-luo authored Oct 13, 2023
2 parents fee8ab5 + 687f341 commit ab9e75a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions src/QMCWaveFunctions/Fermion/MultiDiracDeterminant.2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ void MultiDiracDeterminant::mw_evaluateDetsForPtclMove(const RefVectorWithLeader

PRAGMA_OFFLOAD("omp target teams distribute map(always, from:curRatio_list_ptr[:nw]) \
is_device_ptr(psiV_list_devptr, psiMinv_temp_list_devptr)")
for (size_t iw = 0; iw < nw; iw++)
for (uint32_t iw = 0; iw < nw; iw++)
{
ValueType c_ratio = 0.0;
PRAGMA_OFFLOAD("omp parallel for reduction(+ : c_ratio)")
Expand Down Expand Up @@ -780,9 +780,11 @@ void MultiDiracDeterminant::mw_evaluateDetsAndGradsForPtclMove(
throw std::runtime_error("In MultiDiracDeterminant ompBLAS::copy_batched_offset failed.");


// Index of loop over nw must be 32 bit sized to avoid assignment-after-reduction offload bug
// See https://github.com/QMCPACK/qmcpack/issues/4767
PRAGMA_OFFLOAD("omp target teams distribute is_device_ptr(psiV_list_devptr, psiMinv_temp_list_devptr) \
map(always, from:curRatio_list_ptr[:nw])")
for (size_t iw = 0; iw < nw; iw++)
for (uint32_t iw = 0; iw < nw; iw++)
{
GradType ratioGradRef_local(0);
PRAGMA_OFFLOAD("omp parallel for reduction(+ : ratioGradRef_local)")
Expand Down Expand Up @@ -1048,7 +1050,7 @@ void MultiDiracDeterminant::mw_evaluateGrads(const RefVectorWithLeader<MultiDira

PRAGMA_OFFLOAD("omp target teams distribute is_device_ptr(psiMinv_list_devptr) \
map(always, from: ratioG_list_ptr[:nw])")
for (size_t iw = 0; iw < nw; iw++)
for (uint32_t iw = 0; iw < nw; iw++)
{
ValueType ratioG_local(0);
PRAGMA_OFFLOAD("omp parallel for reduction(+ : ratioG_local)")
Expand Down
4 changes: 2 additions & 2 deletions src/QMCWaveFunctions/Fermion/MultiSlaterDetTableMethod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ void MultiSlaterDetTableMethod::mw_evalGrad_impl(const RefVectorWithLeader<WaveF
map(from: grad_now_list_ptr[:3 * nw]) \
map(always, to: det_value_ptr_list_ptr[:nw]) \
map(to: mw_grads_ptr[:mw_grads.size()])")
for (size_t iw = 0; iw < nw; iw++)
for (uint32_t iw = 0; iw < nw; iw++)
{
// enforce full precision reduction due to numerical sensitivity
PsiValue psi_local(0);
Expand Down Expand Up @@ -600,7 +600,7 @@ void MultiSlaterDetTableMethod::mw_calcRatio(const RefVectorWithLeader<WaveFunct
ScopedTimer local_timer(det_leader.offload_timer);
PRAGMA_OFFLOAD("omp target teams distribute map(always,from: psi_list_ptr[:nw]) \
map(always, to: det_value_ptr_list_ptr[:nw])")
for (size_t iw = 0; iw < nw; iw++)
for (uint32_t iw = 0; iw < nw; iw++)
{
PsiValue psi_local(0);
PRAGMA_OFFLOAD("omp parallel for reduction(+ : psi_local)")
Expand Down

0 comments on commit ab9e75a

Please sign in to comment.