Skip to content

Commit

Permalink
propagating mw_invertPsiM const API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
PDoakORNL committed Oct 6, 2021
1 parent fea01c4 commit 22cc717
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions src/QMCWaveFunctions/Fermion/DiracDeterminantBatched.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ void DiracDeterminantBatched<DET_ENGINE>::invertPsiM(const DualMatrix<Value>& ps

template<typename DET_ENGINE>
void DiracDeterminantBatched<DET_ENGINE>::mw_invertPsiM(const RefVectorWithLeader<WaveFunctionComponent>& wfc_list,
RefVector<const DualMatrix<Value>>& logdetT_list,
RefVector<DualMatrix<Value>>& a_inv_list) const
const RefVector<const DualMatrix<Value>>& logdetT_list,
const RefVector<DualMatrix<Value>>& a_inv_list) const
{
auto& wfc_leader = wfc_list.getCastedLeader<DiracDeterminantBatched<DET_ENGINE>>();
ScopedTimer inverse_timer(wfc_leader.InverseTimer);
Expand Down Expand Up @@ -870,7 +870,7 @@ void DiracDeterminantBatched<DET_ENGINE>::mw_recompute(const RefVectorWithLeader
RefVectorWithLeader<ParticleSet> p_filtered_list(p_list.getLeader());
RefVectorWithLeader<SPOSet> phi_list(*wfc_leader.Phi);
std::vector<Matrix<Value>> psiM_host_views;
RefVector<DualMatrix<Value>> psiM_temp_list;
RefVector<const DualMatrix<Value>> psiM_temp_list;
RefVector<Matrix<Value>> psiM_host_list;
RefVector<Matrix<Grad>> dpsiM_list;
RefVector<Matrix<Value>> d2psiM_list;
Expand Down
6 changes: 3 additions & 3 deletions src/QMCWaveFunctions/Fermion/DiracMatrixComputeCUDA.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class DiracMatrixComputeCUDA : public Resource
* 3. \todo Remove Transfer inv_a_mat to host and let the upper level code handle it.
*/
inline void mw_computeInvertAndLog(CUDALinearAlgebraHandles& cuda_handles,
const RefVector<DualMatrix<VALUE_FP>>& a_mats,
const RefVector<const DualMatrix<VALUE_FP>>& a_mats,
const RefVector<DualMatrix<VALUE_FP>>& inv_a_mats,
const int n,
DualVector<LogValue>& log_values)
Expand Down Expand Up @@ -283,7 +283,7 @@ class DiracMatrixComputeCUDA : public Resource
template<typename TMAT>
inline std::enable_if_t<!std::is_same<VALUE_FP, TMAT>::value> mw_invertTranspose(
CUDALinearAlgebraHandles& cuda_handles,
const RefVector<DualMatrix<TMAT>>& a_mats,
const RefVector<const DualMatrix<TMAT>>& a_mats,
const RefVector<DualMatrix<TMAT>>& inv_a_mats,
DualVector<LogValue>& log_values)
{
Expand Down Expand Up @@ -324,7 +324,7 @@ class DiracMatrixComputeCUDA : public Resource
template<typename TMAT>
inline std::enable_if_t<std::is_same<VALUE_FP, TMAT>::value> mw_invertTranspose(
CUDALinearAlgebraHandles& cuda_handles,
const RefVector<DualMatrix<TMAT>>& a_mats,
const RefVector<const DualMatrix<TMAT>>& a_mats,
const RefVector<DualMatrix<TMAT>>& inv_a_mats,
DualVector<LogValue>& log_values)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ TEST_CASE("DiracMatrixComputeCUDA_large_determinants_benchmark_legacy_1024_4", "
OffloadPinnedVector<std::complex<double>> log_values(params.batch_size);
std::vector<OffloadPinnedMatrix<double>> pinned_inv_mats(params.batch_size, {params.n, params.n});

auto a_mats = makeRefVector<decltype(pinned_spd_mats)::value_type>(pinned_spd_mats);
auto a_mats = makeRefVector<const decltype(pinned_spd_mats)::value_type>(pinned_spd_mats);
RefVector<OffloadPinnedMatrix<double>> inv_a_mats =
makeRefVector<decltype(pinned_inv_mats)::value_type>(pinned_inv_mats);

Expand Down Expand Up @@ -142,7 +142,7 @@ TEST_CASE("benchmark_DiracMatrixComputeCUDA_vs_legacy_256_10", "[wavefunction][f
OffloadPinnedVector<std::complex<double>> log_values(params.batch_size);
std::vector<OffloadPinnedMatrix<double>> pinned_inv_mats(params.batch_size, {params.n, params.n});

auto a_mats = makeRefVector<decltype(pinned_spd_mats)::value_type>(pinned_spd_mats);
auto a_mats = makeRefVector<const decltype(pinned_spd_mats)::value_type>(pinned_spd_mats);
RefVector<OffloadPinnedMatrix<double>> inv_a_mats =
makeRefVector<decltype(pinned_inv_mats)::value_type>(pinned_inv_mats);

Expand Down
8 changes: 4 additions & 4 deletions src/QMCWaveFunctions/tests/test_DiracMatrixComputeCUDA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ TEST_CASE("DiracMatrixComputeCUDA_different_batch_sizes", "[wavefunction][fermio
OffloadPinnedMatrix<double> inv_mat_a2;
inv_mat_a2.resize(4, 4);

RefVector<OffloadPinnedMatrix<double>> a_mats{mat_a, mat_a2};
RefVector<const OffloadPinnedMatrix<double>> a_mats{mat_a, mat_a2};
RefVector<OffloadPinnedMatrix<double>> inv_a_mats{inv_mat_a, inv_mat_a2};

log_values.resize(2);
Expand All @@ -112,7 +112,7 @@ TEST_CASE("DiracMatrixComputeCUDA_different_batch_sizes", "[wavefunction][fermio

a_mats[1] = mat_a3;

RefVector<OffloadPinnedMatrix<double>> a_mats3{mat_a, mat_a2, mat_a3};
RefVector<const OffloadPinnedMatrix<double>> a_mats3{mat_a, mat_a2, mat_a3};
RefVector<OffloadPinnedMatrix<double>> inv_a_mats3{inv_mat_a, inv_mat_a2, inv_mat_a3};

log_values.resize(3);
Expand Down Expand Up @@ -167,7 +167,7 @@ TEST_CASE("DiracMatrixComputeCUDA_complex_determinants_against_legacy", "[wavefu
OffloadPinnedMatrix<std::complex<double>> inv_mat_a2;
inv_mat_a2.resize(n, n);

RefVector<OffloadPinnedMatrix<std::complex<double>>> a_mats{mat_a, mat_a2};
RefVector<const OffloadPinnedMatrix<std::complex<double>>> a_mats{mat_a, mat_a2};
RefVector<OffloadPinnedMatrix<std::complex<double>>> inv_a_mats{inv_mat_a, inv_mat_a2};

dmcc.mw_invertTranspose(*cuda_handles, a_mats, inv_a_mats, log_values);
Expand Down Expand Up @@ -222,7 +222,7 @@ TEST_CASE("DiracMatrixComputeCUDA_large_determinants_against_legacy", "[wavefunc
OffloadPinnedMatrix<double> inv_mat_a2;
inv_mat_a2.resize(n, n);

RefVector<OffloadPinnedMatrix<double>> a_mats{mat_a, mat_a2};
RefVector<const OffloadPinnedMatrix<double>> a_mats{mat_a, mat_a2};
RefVector<OffloadPinnedMatrix<double>> inv_a_mats{inv_mat_a, inv_mat_a2};

dmcc.mw_invertTranspose(*cuda_handles, a_mats, inv_a_mats, log_values);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ TEST_CASE("DiracMatrixComputeOMPTarget_different_batch_sizes", "[wavefunction][f
OffloadPinnedMatrix<double> inv_mat_a2;
inv_mat_a2.resize(4, 4);

RefVector<OffloadPinnedMatrix<double>> a_mats{mat_a, mat_a2};
RefVector<const OffloadPinnedMatrix<double>> a_mats{mat_a, mat_a2};
RefVector<OffloadPinnedMatrix<double>> inv_a_mats{inv_mat_a, inv_mat_a2};

log_values.resize(2);
Expand All @@ -93,7 +93,7 @@ TEST_CASE("DiracMatrixComputeOMPTarget_different_batch_sizes", "[wavefunction][f

a_mats[1] = mat_a3;

RefVector<OffloadPinnedMatrix<double>> a_mats3{mat_a, mat_a2, mat_a3};
RefVector<const OffloadPinnedMatrix<double>> a_mats3{mat_a, mat_a2, mat_a3};
RefVector<OffloadPinnedMatrix<double>> inv_a_mats3{inv_mat_a, inv_mat_a2, inv_mat_a3};

log_values.resize(3);
Expand Down Expand Up @@ -147,7 +147,7 @@ TEST_CASE("DiracMatrixComputeOMPTarget_large_determinants_against_legacy", "[wav
OffloadPinnedMatrix<double> inv_mat_a2;
inv_mat_a2.resize(n, n);

RefVector<OffloadPinnedMatrix<double>> a_mats{mat_a, mat_a2};
RefVector<const OffloadPinnedMatrix<double>> a_mats{mat_a, mat_a2};
RefVector<OffloadPinnedMatrix<double>> inv_a_mats{inv_mat_a, inv_mat_a2};


Expand Down

0 comments on commit 22cc717

Please sign in to comment.