From 105a3b388ab628386fa7fd4796a0c70d7e65df9d Mon Sep 17 00:00:00 2001 From: Ye Luo Date: Fri, 11 Oct 2024 17:37:45 -0500 Subject: [PATCH 1/2] Keep positions in ST. --- .../BsplineFactory/SplineC2ROMPTarget.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/QMCWaveFunctions/BsplineFactory/SplineC2ROMPTarget.cpp b/src/QMCWaveFunctions/BsplineFactory/SplineC2ROMPTarget.cpp index 482be8b664..0ae14e55cd 100644 --- a/src/QMCWaveFunctions/BsplineFactory/SplineC2ROMPTarget.cpp +++ b/src/QMCWaveFunctions/BsplineFactory/SplineC2ROMPTarget.cpp @@ -288,7 +288,7 @@ void SplineC2ROMPTarget::mw_evaluateDetRatios(const RefVectorWithLeader::mw_evaluateDetRatios(const RefVectorWithLeader(det_ratios_buffer_H2D.data() + nw * sizeof(ValueType*)); + auto* pos_ptr = reinterpret_cast(det_ratios_buffer_H2D.data() + nw * sizeof(ValueType*)); auto* ref_id_ptr = - reinterpret_cast(det_ratios_buffer_H2D.data() + nw * sizeof(ValueType*) + mw_nVP * 6 * sizeof(TT)); + reinterpret_cast(det_ratios_buffer_H2D.data() + nw * sizeof(ValueType*) + mw_nVP * 6 * sizeof(ST)); size_t iVP = 0; for (size_t iw = 0; iw < nw; iw++) { @@ -353,14 +353,14 @@ void SplineC2ROMPTarget::mw_evaluateDetRatios(const RefVectorWithLeader(buffer_H2D_ptr + nw * sizeof(ValueType*) + mw_nVP * 6 * sizeof(TT)); + auto* ref_id_ptr = reinterpret_cast(buffer_H2D_ptr + nw * sizeof(ValueType*) + mw_nVP * 6 * sizeof(ST)); auto* restrict psiinv_ptr = reinterpret_cast(buffer_H2D_ptr)[ref_id_ptr[iat]]; - auto* restrict pos_scratch = reinterpret_cast(buffer_H2D_ptr + nw * sizeof(ValueType*)); + auto* restrict pos_scratch = reinterpret_cast(buffer_H2D_ptr + nw * sizeof(ValueType*)); int ix, iy, iz; ST a[4], b[4], c[4]; - spline2::computeLocationAndFractional(spline_ptr, ST(pos_scratch[iat * 6 + 3]), ST(pos_scratch[iat * 6 + 4]), - ST(pos_scratch[iat * 6 + 5]), ix, iy, iz, a, b, c); + spline2::computeLocationAndFractional(spline_ptr, pos_scratch[iat * 6 + 3], pos_scratch[iat * 6 + 4], + pos_scratch[iat * 6 + 5], ix, iy, iz, a, b, c); PRAGMA_OFFLOAD("omp parallel for") for (int index = 0; index < last - first; index++) @@ -370,7 +370,7 @@ void SplineC2ROMPTarget::mw_evaluateDetRatios(const RefVectorWithLeader Date: Thu, 17 Oct 2024 00:12:32 -0500 Subject: [PATCH 2/2] Increase d2psiM test tolerance in LiH-x --- src/QMCWaveFunctions/tests/test_einset_LiH.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/QMCWaveFunctions/tests/test_einset_LiH.cpp b/src/QMCWaveFunctions/tests/test_einset_LiH.cpp index aafb310c7b..4bd3a536cf 100644 --- a/src/QMCWaveFunctions/tests/test_einset_LiH.cpp +++ b/src/QMCWaveFunctions/tests/test_einset_LiH.cpp @@ -113,7 +113,7 @@ void test_einset_LiH_x(bool use_offload) CHECK(std::real(dpsiM[1][1][2]) == Approx(0.4088463187)); // lapl CHECK(std::real(d2psiM[1][0]) == Approx(1.7295608521).epsilon(4e-5)); - CHECK(std::real(d2psiM[1][1]) == Approx(0.7432643771)); + CHECK(std::real(d2psiM[1][1]) == Approx(0.7432643771).epsilon(2e-5)); #else CHECK(std::real(psiM[1][0]) == Approx(-1.1857329607)); CHECK(std::real(psiM[1][1]) == Approx(0.4717386365));