QMCPACK
DTModes.h
Go to the documentation of this file.
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_DTMODES_H
14 #define QMCPLUSPLUS_DTMODES_H
15 
16 #include <cstdint>
17 
18 namespace qmcplusplus
19 {
20 enum class DTModes : uint_fast8_t
21 {
22  ALL_OFF = 0x0,
23  /** whether full table needs to be ready at anytime or not during PbyP
24  * Optimization can be implemented during forward PbyP move when the full table is not needed all the time.
25  * DT consumers should know if full table is needed or not and request via addTable.
26  */
28  /** For distance tables of virtual particle (VP) sets constructed based on this table, whether full table is needed on host
29  * The corresponding DT of VP need to set MW_EVALUATE_RESULT_NO_TRANSFER_TO_HOST accordingly.
30  */
32  /** whether temporary data set on the host is updated or not when a move is proposed.
33  * Considering transferring data from accelerator to host is relatively expensive,
34  * only request this when data on host is needed for unoptimized code path.
35  * This flag affects three subroutines mw_move, mw_updatePartial, mw_finalizePbyP in DistanceTable.
36  */
38  /** skip data transfer back to host after mw_evalaute full distance table.
39  * this optimization can be used for distance table consumed directly on the device without copying back to the host.
40  */
42  /** whether full table needs to be ready at anytime or not after donePbyP
43  * Optimization can be implemented during forward PbyP move when the full table is not needed all the time.
44  * DT consumers should know if full table is needed or not and request via addTable.
45  */
47 };
48 
49 constexpr bool operator&(DTModes x, DTModes y)
50 {
51  return (static_cast<uint_fast8_t>(x) & static_cast<uint_fast8_t>(y)) != 0x0;
52 }
53 
55 {
56  return static_cast<DTModes>(static_cast<uint_fast8_t>(x) | static_cast<uint_fast8_t>(y));
57 }
58 
59 constexpr DTModes operator~(DTModes x) { return static_cast<DTModes>(~static_cast<uint_fast8_t>(x)); }
60 
62 {
63  x = x | y;
64  return x;
65 }
66 } // namespace qmcplusplus
67 #endif
Matrix< T1, C1 > & operator|=(Matrix< T1, C1 > &lhs, const RHS &rhs)
helper functions for EinsplineSetBuilder
Definition: Configuration.h:43
MakeReturn< UnaryNode< OpBitwiseNot, typename CreateLeaf< Matrix< T1, C1 > >::Leaf_t > >::Expression_t operator~(const Matrix< T1, C1 > &l)
For distance tables of virtual particle (VP) sets constructed based on this table, whether full table is needed on host The corresponding DT of VP need to set MW_EVALUATE_RESULT_NO_TRANSFER_TO_HOST accordingly.
MakeReturn< BinaryNode< OpBitwiseAnd, typename CreateLeaf< Matrix< T1, C1 > >::Leaf_t, typename CreateLeaf< Matrix< T2, C2 > >::Leaf_t > >::Expression_t operator &(const Matrix< T1, C1 > &l, const Matrix< T2, C2 > &r)
whether full table needs to be ready at anytime or not during PbyP Optimization can be implemented du...
whether full table needs to be ready at anytime or not after donePbyP Optimization can be implemented...
whether temporary data set on the host is updated or not when a move is proposed. ...
skip data transfer back to host after mw_evalaute full distance table.
MakeReturn< BinaryNode< OpBitwiseOr, typename CreateLeaf< Matrix< T1, C1 > >::Leaf_t, typename CreateLeaf< Matrix< T2, C2 > >::Leaf_t > >::Expression_t operator|(const Matrix< T1, C1 > &l, const Matrix< T2, C2 > &r)