21#ifndef _libint2_src_bin_libint_defaultparams_h_
22#define _libint2_src_bin_libint_defaultparams_h_
40 std::string default_task_name_;
48 unsigned int max_am(std::string t =
"",
unsigned int c = 0)
const;
50 unsigned int max_am_opt(std::string t =
"")
const;
52 unsigned int num_bf(std::string t =
"")
const;
64 const std::string&
api_prefix()
const {
return api_prefix_; }
76 const std::string&
realtype()
const {
return realtype_; }
83 void max_am(
const std::string& t,
unsigned int a,
unsigned int c = 0);
85 void max_am_opt(
const std::string& t,
unsigned int a);
87 void num_bf(
const std::string& t,
unsigned int a);
99 void api_prefix(
const std::string& a) { api_prefix_ = a; }
118 void print(std::ostream& os)
const;
123 static const unsigned int max_am = 1;
125 static const unsigned int max_am_opt = 1;
127 static const unsigned int num_bf = 4;
129 static const unsigned int max_vector_length = 1;
131 static const bool vectorize_by_line =
false;
133 static const unsigned int align_size = 0;
135 static const unsigned int unroll_threshold = 0;
137 static const std::string source_directory;
139 static const std::string api_prefix;
141 static const bool single_evaltype =
true;
143 static const bool use_C_linking =
true;
145 static const bool count_flops =
false;
147 static const bool profile =
false;
149 static const bool accumulate_targets =
false;
151 static const std::string realtype;
153 static const bool contracted_targets =
false;
155 static const std::string task_name;
158 struct TaskParameters {
160 std::vector<unsigned int> max_am;
162 unsigned int max_am_opt;
166 TaskParameters() : max_am(1, 0u), max_am_opt(0u), num_bf(0u) {}
169 std::map<std::string, TaskParameters> task_params_;
172 void task_exists(
const std::string& t)
const;
174 void add_task(
const std::string& t);
177 unsigned int max_vector_length_;
179 bool vectorize_by_line_;
184 unsigned int align_size_;
186 unsigned int unroll_threshold_;
188 std::string source_directory_;
190 std::string api_prefix_;
192 bool single_evaltype_;
200 bool accumulate_targets_;
202 std::string realtype_;
204 bool contracted_targets_;
219 unsigned int max_am()
const {
return max_stack_size_.size() - 1; }
222 return max_stack_size_.at(am);
230 if (am + 1 > max_vector_stack_size_.size())
233 return max_vector_stack_size_[am];
239 if (am + 1 > max_hrr_hsrank_.size())
242 return max_hrr_hsrank_[am];
248 if (am + 1 > max_hrr_lsrank_.size())
251 return max_hrr_lsrank_[am];
256 if (max_ntarget_ < ntarget) max_ntarget_ = ntarget;
261 extend_max_size(max_stack_size_, am, size);
266 extend_max_size(max_vector_stack_size_, am, size);
271 extend_max_size(max_hrr_hsrank_, am, rank);
276 extend_max_size(max_hrr_lsrank_, am, rank);
280 unsigned int max_ntarget_;
281 std::vector<unsigned int>
284 std::vector<unsigned int> max_vector_stack_size_;
285 std::vector<unsigned int> max_hrr_hsrank_;
286 std::vector<unsigned int> max_hrr_lsrank_;
288 static void extend_max_size(std::vector<unsigned int>& max_size,
289 unsigned int am,
unsigned int size) {
290 const int max_am = (int)max_size.size() - 1u;
292 max_size.resize(am + 1);
293 for (
int l = std::max(
max_am + 1, 1); l <= (int)am; ++l)
294 max_size[l] = max_size[l - 1];
296 if (max_size[am] < size) max_size[am] = size;
307bool condense_expr(
unsigned int unroll_threshold,
bool vectorize);
These are the parameters received by the compiler.
Definition default_params.h:39
void vectorize_by_line(bool flag)
set vectorize_by_line flag
Definition default_params.h:91
void unroll_threshold(unsigned int a)
set unroll threshold
Definition default_params.h:95
bool profile() const
whether profiling instrumentation is enabled
Definition default_params.h:72
void use_C_linking(bool a)
set whether to use C style linking
Definition default_params.h:103
unsigned int max_vector_length() const
returns max vector length
Definition default_params.h:54
bool count_flops() const
whether FLOP counting is enabled
Definition default_params.h:70
void align_size(unsigned int a)
set alignment size (in units of sizeof(LIBINT_FLOAT))
Definition default_params.h:93
unsigned int num_bf(std::string t="") const
returns number of basis functions in integrals for task t
Definition default_params.cc:123
bool single_evaltype() const
generate single evaluator type (i.e. not specific to each task)?
Definition default_params.h:66
bool use_C_linking() const
returns whether to use C-style linking
Definition default_params.h:68
void default_task_name(const std::string &s)
default task name
Definition default_params.h:115
void source_directory(const std::string &a)
set generated source directory
Definition default_params.h:97
bool vectorize_by_line() const
returns whether to vectorize line-by-line
Definition default_params.h:56
void api_prefix(const std::string &a)
API prefix.
Definition default_params.h:99
void accumulate_targets(bool a)
accumulate targets?
Definition default_params.h:109
void print(std::ostream &os) const
print params out
Definition default_params.cc:55
void profile(bool a)
set to instrument profiling
Definition default_params.h:107
unsigned int unroll_threshold() const
returns unroll threshold
Definition default_params.h:58
void count_flops(bool a)
set whether to count FLOPs
Definition default_params.h:105
const std::string & realtype() const
name of the floating-point type
Definition default_params.h:76
const std::string & api_prefix() const
the API prefix
Definition default_params.h:64
void realtype(const std::string &realtype)
which floating-point type to use
Definition default_params.h:111
const std::string & default_task_name() const
default task name
Definition default_params.h:80
const std::string & source_directory() const
returns directory path for the generated source
Definition default_params.h:62
unsigned int align_size() const
returns alignment size (in units of sizeof(LIBINT_FLOAT))
Definition default_params.h:60
bool accumulate_targets() const
whether target integrals are accumulated
Definition default_params.h:74
CompilationParameters()
Use default parameters.
Definition default_params.cc:35
bool contracted_targets() const
whether contracted targets are supported
Definition default_params.h:78
void contracted_targets(bool c)
support contracted targets?
Definition default_params.h:113
unsigned int max_am_opt(std::string t="") const
returns max AM for which to produce optimal code for task t
Definition default_params.cc:111
unsigned int max_am(std::string t="", unsigned int c=0) const
returns max AM for task t and center c
Definition default_params.cc:98
void max_vector_length(unsigned int a)
set max vector length
Definition default_params.h:89
void single_evaltype(bool se)
generate a single evaluator type (i.e. not specific to each task)?
Definition default_params.h:101
This class maintains various parameters for each task type which can only be determined during the so...
Definition default_params.h:211
unsigned int max_hrr_hsrank(unsigned int am) const
returns max rank of high-significance functions in a HRR call.
Definition default_params.h:238
void max_stack_size(unsigned int am, unsigned int size)
if max_stack_size_ < size then set max_stack_size_=size
Definition default_params.h:260
unsigned int max_vector_stack_size(unsigned int am) const
returns max vector stack size.
Definition default_params.h:229
void max_hrr_lsrank(unsigned int am, unsigned int rank)
if max_hrr_lsrank_ < rank then set max_hrr_lsrank_=rank
Definition default_params.h:275
unsigned int max_am() const
returns the max quantum number of targets
Definition default_params.h:219
void max_vector_stack_size(unsigned int am, unsigned int size)
if max_vector_stack_size_ < size then set max_vector_stack_size_=size
Definition default_params.h:265
unsigned int max_stack_size(unsigned int am) const
returns max stack size needed for quantum numbers up to am
Definition default_params.h:221
void max_ntarget(unsigned int ntarget)
if max_ntarget_ < ntarget then set max_ntarget_=ntarget
Definition default_params.h:255
void max_hrr_hsrank(unsigned int am, unsigned int rank)
if max_hrr_hsrank_ < rank then set max_hrr_hsrank_=rank
Definition default_params.h:270
unsigned int max_ntarget() const
returns the max number of targets
Definition default_params.h:217
unsigned int max_hrr_lsrank(unsigned int am) const
returns max rank of low-significance functions in a HRR call.
Definition default_params.h:247
Defaults definitions for various parameters assumed by Libint.
Definition algebra.cc:24
std::string label_to_funcname(const std::string &label)
Converts a label, e.g.
Definition default_params.cc:201
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:212