1 //////////////////////////////////////////////////////////////////////////////////////
2 // This file is distributed under the University of Illinois/NCSA Open Source License.
3 // See LICENSE file in top directory for details.
4 //
5 // Copyright (c) 2021 QMCPACK developers.
6 //
7 // File developed by: Ye Luo, yeluo@anl.gov, Argonne National Laboratory
8 //
9 // File created by: Ye Luo, yeluo@anl.gov, Argonne National Laboratory
10 //////////////////////////////////////////////////////////////////////////////////////
11 
12 
13 #ifndef QMCPLUSPLUS_HDISPATCH_H
14 #define QMCPLUSPLUS_HDISPATCH_H
15 
16 #include "QMCHamiltonian.h"
17 
18 namespace qmcplusplus
19 {
20 /** Wrappers for dispatching to QMCHamiltonian single walker APIs or mw_ APIs.
21  * This should be only used by QMC drivers.
22  * member function names must match mw_ APIs in QMCHamiltonian
23  */
24 class Hdispatcher
25 {
26 public:
27   using FullPrecRealType = QMCHamiltonian::FullPrecRealType;
28 
29   Hdispatcher(bool use_batch);
30 
31   std::vector<FullPrecRealType> flex_evaluate(const RefVectorWithLeader<QMCHamiltonian>& ham_list,
32                                                               const RefVectorWithLeader<ParticleSet>& p_list) const;
33 
34   std::vector<FullPrecRealType> flex_evaluateWithToperator(
35       const RefVectorWithLeader<QMCHamiltonian>& ham_list,
36       const RefVectorWithLeader<ParticleSet>& p_list) const;
37 
38   std::vector<int> flex_makeNonLocalMoves(const RefVectorWithLeader<QMCHamiltonian>& ham_list,
39                                           const RefVectorWithLeader<ParticleSet>& p_list) const;
40 
41 private:
42   bool use_batch_;
43 };
44 } // namespace qmcplusplus
45 
46 #endif
47