Skip to content

Commit

Permalink
Merge pull request #4443 from ye-luo/fix-spline-blocking-offset
Browse files Browse the repository at this point in the history
Fix spline block offset caused by #4439
  • Loading branch information
prckent authored Feb 7, 2023
2 parents b1e7aae + 7521263 commit f437528
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions src/QMCWaveFunctions/BsplineFactory/SplineC2COMPTarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ void SplineC2COMPTarget<ST>::evaluateDetRatios(const VirtualParticleSet& VP,

PRAGMA_OFFLOAD("omp parallel for")
for (int index = 0; index < last - first; index++)
spline2offload::evaluate_v_impl_v2(spline_ptr, ix, iy, iz, index, a, b, c,
spline2offload::evaluate_v_impl_v2(spline_ptr, ix, iy, iz, first + index, a, b, c,
offload_scratch_iat_ptr + first + index);
const size_t first_cplx = first / 2;
const size_t last_cplx = omptarget::min(last / 2, orb_size);
Expand Down Expand Up @@ -280,7 +280,7 @@ void SplineC2COMPTarget<ST>::mw_evaluateDetRatios(const RefVectorWithLeader<SPOS

PRAGMA_OFFLOAD("omp parallel for")
for (int index = 0; index < last - first; index++)
spline2offload::evaluate_v_impl_v2(spline_ptr, ix, iy, iz, index, a, b, c,
spline2offload::evaluate_v_impl_v2(spline_ptr, ix, iy, iz, first + index, a, b, c,
offload_scratch_iat_ptr + first + index);
const size_t first_cplx = first / 2;
const size_t last_cplx = omptarget::min(last / 2, orb_size);
Expand Down Expand Up @@ -430,7 +430,7 @@ void SplineC2COMPTarget<ST>::evaluateVGL(const ParticleSet& P,
PRAGMA_OFFLOAD("omp parallel for")
for (int index = 0; index < last - first; index++)
{
spline2offload::evaluate_vgh_impl_v2(spline_ptr, ix, iy, iz, index, a, b, c, da, db, dc, d2a, d2b, d2c,
spline2offload::evaluate_vgh_impl_v2(spline_ptr, ix, iy, iz, first + index, a, b, c, da, db, dc, d2a, d2b, d2c,
offload_scratch_ptr + first + index, padded_size);
const int output_index = first + index;
offload_scratch_ptr[padded_size * SoAFields3D::LAPL + output_index] =
Expand Down Expand Up @@ -518,7 +518,7 @@ void SplineC2COMPTarget<ST>::evaluateVGLMultiPos(const Vector<ST, OffloadPinnedA
PRAGMA_OFFLOAD("omp parallel for")
for (int index = 0; index < last - first; index++)
{
spline2offload::evaluate_vgh_impl_v2(spline_ptr, ix, iy, iz, index, a, b, c, da, db, dc, d2a, d2b, d2c,
spline2offload::evaluate_vgh_impl_v2(spline_ptr, ix, iy, iz, first + index, a, b, c, da, db, dc, d2a, d2b, d2c,
offload_scratch_iw_ptr + first + index, padded_size);
const int output_index = first + index;
offload_scratch_iw_ptr[padded_size * SoAFields3D::LAPL + output_index] =
Expand Down Expand Up @@ -694,7 +694,7 @@ void SplineC2COMPTarget<ST>::mw_evaluateVGLandDetRatioGrads(const RefVectorWithL
PRAGMA_OFFLOAD("omp parallel for")
for (int index = 0; index < last - first; index++)
{
spline2offload::evaluate_vgh_impl_v2(spline_ptr, ix, iy, iz, index, a, b, c, da, db, dc, d2a, d2b, d2c,
spline2offload::evaluate_vgh_impl_v2(spline_ptr, ix, iy, iz, first + index, a, b, c, da, db, dc, d2a, d2b, d2c,
offload_scratch_iw_ptr + first + index, padded_size);
const int output_index = first + index;
offload_scratch_iw_ptr[padded_size * SoAFields3D::LAPL + output_index] =
Expand Down
12 changes: 6 additions & 6 deletions src/QMCWaveFunctions/BsplineFactory/SplineC2ROMPTarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ void SplineC2ROMPTarget<ST>::evaluateValue(const ParticleSet& P, const int iat,

PRAGMA_OFFLOAD("omp parallel for")
for (int index = 0; index < last - first; index++)
spline2offload::evaluate_v_impl_v2(spline_ptr, ix, iy, iz, index, a, b, c,
spline2offload::evaluate_v_impl_v2(spline_ptr, ix, iy, iz, first + index, a, b, c,
offload_scratch_ptr + first + index);
const size_t first_cplx = first / 2;
const size_t last_cplx = last / 2;
Expand Down Expand Up @@ -231,7 +231,7 @@ void SplineC2ROMPTarget<ST>::evaluateDetRatios(const VirtualParticleSet& VP,

PRAGMA_OFFLOAD("omp parallel for")
for (int index = 0; index < last - first; index++)
spline2offload::evaluate_v_impl_v2(spline_ptr, ix, iy, iz, index, a, b, c,
spline2offload::evaluate_v_impl_v2(spline_ptr, ix, iy, iz, first + index, a, b, c,
offload_scratch_iat_ptr + first + index);
const size_t first_cplx = first / 2;
const size_t last_cplx = last / 2;
Expand Down Expand Up @@ -357,7 +357,7 @@ void SplineC2ROMPTarget<ST>::mw_evaluateDetRatios(const RefVectorWithLeader<SPOS

PRAGMA_OFFLOAD("omp parallel for")
for (int index = 0; index < last - first; index++)
spline2offload::evaluate_v_impl_v2(spline_ptr, ix, iy, iz, index, a, b, c,
spline2offload::evaluate_v_impl_v2(spline_ptr, ix, iy, iz, first + index, a, b, c,
offload_scratch_iat_ptr + first + index);
const size_t first_cplx = first / 2;
const size_t last_cplx = last / 2;
Expand Down Expand Up @@ -569,7 +569,7 @@ void SplineC2ROMPTarget<ST>::evaluateVGL(const ParticleSet& P,
PRAGMA_OFFLOAD("omp parallel for")
for (int index = 0; index < last - first; index++)
{
spline2offload::evaluate_vgh_impl_v2(spline_ptr, ix, iy, iz, index, a, b, c, da, db, dc, d2a, d2b, d2c,
spline2offload::evaluate_vgh_impl_v2(spline_ptr, ix, iy, iz, first + index, a, b, c, da, db, dc, d2a, d2b, d2c,
offload_scratch_ptr + first + index, spline_padded_size);
const int output_index = first + index;
offload_scratch_ptr[spline_padded_size * SoAFields3D::LAPL + output_index] =
Expand Down Expand Up @@ -660,7 +660,7 @@ void SplineC2ROMPTarget<ST>::evaluateVGLMultiPos(const Vector<ST, OffloadPinnedA
PRAGMA_OFFLOAD("omp parallel for")
for (int index = 0; index < last - first; index++)
{
spline2offload::evaluate_vgh_impl_v2(spline_ptr, ix, iy, iz, index, a, b, c, da, db, dc, d2a, d2b, d2c,
spline2offload::evaluate_vgh_impl_v2(spline_ptr, ix, iy, iz, first + index, a, b, c, da, db, dc, d2a, d2b, d2c,
offload_scratch_iw_ptr + first + index, spline_padded_size);
const int output_index = first + index;
offload_scratch_iw_ptr[spline_padded_size * SoAFields3D::LAPL + output_index] =
Expand Down Expand Up @@ -838,7 +838,7 @@ void SplineC2ROMPTarget<ST>::mw_evaluateVGLandDetRatioGrads(const RefVectorWithL
PRAGMA_OFFLOAD("omp parallel for")
for (int index = 0; index < last - first; index++)
{
spline2offload::evaluate_vgh_impl_v2(spline_ptr, ix, iy, iz, index, a, b, c, da, db, dc, d2a, d2b, d2c,
spline2offload::evaluate_vgh_impl_v2(spline_ptr, ix, iy, iz, first + index, a, b, c, da, db, dc, d2a, d2b, d2c,
offload_scratch_iw_ptr + first + index, spline_padded_size);
const int output_index = first + index;
offload_scratch_iw_ptr[spline_padded_size * SoAFields3D::LAPL + output_index] =
Expand Down

0 comments on commit f437528

Please sign in to comment.