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