LIBINT  2.6.0
graph_registry.h
1 /*
2  * Copyright (C) 2004-2019 Edward F. Valeev
3  *
4  * This file is part of Libint.
5  *
6  * Libint is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * Libint is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with Libint. If not, see <http://www.gnu.org/licenses/>.
18  *
19  */
20 
21 #ifndef _libint2_src_bin_libint_tforms_h_
22 #define _libint2_src_bin_libint_tforms_h_
23 
24 #include <string>
25 #include <memory.h>
26 
27 using namespace std;
28 
29 
30 namespace libint2 {
31 
36  class GraphRegistry {
37  public:
38  GraphRegistry();
39  ~GraphRegistry();
40 
41  GraphRegistry* clone() const;
42 
44  bool accumulate_targets() const { return accumulate_targets_; }
45  void accumulate_targets(bool at) { accumulate_targets_ = at; }
47  bool return_targets() const { return return_targets_; }
48  void return_targets(bool rt) { return_targets_ = rt; }
50  unsigned int unroll_threshold() const { return unroll_threshold_; }
51  void unroll_threshold(unsigned int ut) {
52  unroll_threshold_ = ut;
53  }
56  bool uncontract() const { return uncontract_; }
57  void uncontract(bool uc) { uncontract_ = uc; }
59  bool ignore_missing_prereqs() const { return ignore_missing_prereqs_; }
60  void ignore_missing_prereqs(bool imp) { ignore_missing_prereqs_ = imp; }
62  bool do_cse() const { return do_cse_; }
63  void do_cse(bool dc) { do_cse_ = dc; }
65  const std::string& stack_name() const { return stack_name_; }
66  void stack_name(const std::string& stack_name) { stack_name_ = stack_name; }
68  bool condense_expr() const { return condense_expr_; }
69  void condense_expr(bool ce) { condense_expr_ = ce; }
71  int current_timer() const { return current_timer_; }
72  void current_timer(int ct) { current_timer_ = ct; }
73 
74  private:
75  bool accumulate_targets_;
76  bool return_targets_;
77  unsigned int unroll_threshold_;
78  bool uncontract_;
79  bool ignore_missing_prereqs_;
80  bool do_cse_;
81  bool condense_expr_;
82  std::string stack_name_;
83  int current_timer_;
84  };
85 
90  public:
93 
95  bool accumulate_targets_directly() const { return accumulate_targets_directly_; }
96  void accumulate_targets_directly(bool atd) { accumulate_targets_directly_ = atd; }
98  MemoryManager::Size size_of_target_accum() const { return size_of_target_accum_; }
99  void size_of_target_accum(const MemoryManager::Size& sota) { size_of_target_accum_ = sota; }
100 
101  private:
102  bool accumulate_targets_directly_;
103  MemoryManager::Size size_of_target_accum_;
104  };
105 
106 }
107 
108 #endif
109 
bool condense_expr() const
Condense expressions? The default is false.
Definition: graph_registry.h:68
bool uncontract() const
Minimum size when can unroll Will uncontract the integral sets if true.
Definition: graph_registry.h:56
bool condense_expr(unsigned int unroll_threshold, bool vectorize)
need to condense expressions? Makes sense if vectorizing the code or the compiler somehow prefers lon...
Definition: default_params.cc:229
bool ignore_missing_prereqs() const
Ignore missing prerequisites – generate the code as is, without generating code for the prerequisites...
Definition: graph_registry.h:59
Defaults definitions for various parameters assumed by Libint.
Definition: algebra.cc:24
int current_timer() const
if -1, no profiling, otherwise, indicates the current timer
Definition: graph_registry.h:71
Internal registry of information.
Definition: graph_registry.h:89
bool accumulate_targets() const
Accumulate (true) or assign (false) target vertices? The default is to assign.
Definition: graph_registry.h:44
unsigned int unroll_threshold() const
Will unroll the integral sets with size <= unroll_threshold. Default is 0 (no unrolling).
Definition: graph_registry.h:50
MemoryManager::Size size_of_target_accum() const
The size of the buffer at the beginning of stack allocated to hold accumulated targets.
Definition: graph_registry.h:98
bool accumulate_targets_directly() const
Are targets computed, then accumulated, or accumulated directly? The latter possible only if all targ...
Definition: graph_registry.h:95
bool return_targets() const
Return pointers to targets via Libint_t::targets? Default is true.
Definition: graph_registry.h:47
bool do_cse() const
Do Common Subexpression Elimination (CSE)? The default is false.
Definition: graph_registry.h:62
Externally accessible registry of information about a graph.
Definition: graph_registry.h:36
const std::string & stack_name() const
Names the primary scratch space for the intermediates. The default is "libint->stack".
Definition: graph_registry.h:65