21 #ifndef _libint2_src_bin_libint_defaultparams_h_ 22 #define _libint2_src_bin_libint_defaultparams_h_ 29 #include <smart_ptr.h> 39 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;
55 return max_vector_length_;
59 return vectorize_by_line_;
63 return unroll_threshold_;
71 return source_directory_;
79 return single_evaltype_;
83 return use_C_linking_;
95 return accumulate_targets_;
103 return contracted_targets_;
107 return default_task_name_;
111 void max_am(
const std::string& t,
unsigned int a,
unsigned int c=0);
113 void max_am_opt(
const std::string& t,
unsigned int a);
115 void num_bf(
const std::string& t,
unsigned int a);
118 max_vector_length_ = a;
122 vectorize_by_line_ = flag;
130 unroll_threshold_ = a;
134 source_directory_ = a;
142 single_evaltype_ = se;
158 accumulate_targets_ = a;
166 contracted_targets_ = c;
170 default_task_name_ = s;
174 void print(std::ostream& os)
const;
179 static const unsigned int max_am = 1;
183 static const unsigned int num_bf = 4;
203 static const bool profile =
false;
211 static const std::string task_name;
214 struct TaskParameters {
216 std::vector<unsigned int>
max_am;
225 std::map<std::string,TaskParameters> task_params_;
227 void task_exists(
const std::string& t)
const;
229 void add_task(
const std::string& t);
232 unsigned int max_vector_length_;
234 bool vectorize_by_line_;
238 unsigned int align_size_;
240 unsigned int unroll_threshold_;
242 std::string source_directory_;
244 std::string api_prefix_;
246 bool single_evaltype_;
254 bool accumulate_targets_;
256 std::string realtype_;
258 bool contracted_targets_;
276 return max_stack_size_.size() - 1;
280 return max_stack_size_.at(am);
287 if (am + 1 > max_vector_stack_size_.size())
290 return max_vector_stack_size_[am];
296 if (am + 1 > max_hrr_hsrank_.size())
299 return max_hrr_hsrank_[am];
305 if (am + 1 > max_hrr_lsrank_.size())
308 return max_hrr_lsrank_[am];
313 if (max_ntarget_ < ntarget)
314 max_ntarget_ = ntarget;
319 extend_max_size(max_stack_size_, am, size);
324 extend_max_size(max_vector_stack_size_, am, size);
329 extend_max_size(max_hrr_hsrank_, am, rank);
334 extend_max_size(max_hrr_lsrank_, am, rank);
338 unsigned int max_ntarget_;
339 std::vector<unsigned int> max_stack_size_;
340 std::vector<unsigned int> max_vector_stack_size_;
341 std::vector<unsigned int> max_hrr_hsrank_;
342 std::vector<unsigned int> max_hrr_lsrank_;
344 static void extend_max_size(std::vector<unsigned int>& max_size,
unsigned int am,
unsigned int size) {
345 const int max_am = (int)max_size.size() - 1u;
347 max_size.resize(am + 1);
348 for(
int l = std::max(
max_am+1,1); l<=(int)am; ++l)
349 max_size[l] = max_size[l-1];
351 if (max_size[am] < size)
371 bool condense_expr(
unsigned int unroll_threshold,
bool vectorize);
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:333
bool profile() const
whether profiling instrumentation is enabled
Definition: default_params.h:90
unsigned int max_hrr_hsrank(unsigned int am) const
returns max rank of high-significance functions in a HRR call.
Definition: default_params.h:295
void source_directory(const std::string &a)
set generated source directory
Definition: default_params.h:133
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:318
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:323
void vectorize_by_line(bool flag)
set vectorize_by_line flag
Definition: default_params.h:121
bool vectorize_by_line() const
returns whether to vectorize line-by-line
Definition: default_params.h:58
Static parameters.
Definition: default_params.h:357
std::string label_to_funcname(const std::string &label)
Converts a label, e.g. name of the target node, to the name of the function to compute it.
Definition: default_params.cc:216
const std::string & source_directory() const
returns directory path for the generated source
Definition: default_params.h:70
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:100
void unroll_threshold(unsigned int a)
set unroll threshold
Definition: default_params.h:129
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
void single_evaltype(bool se)
generate a single evaluator type (i.e. not specific to each task)?
Definition: default_params.h:141
void contracted_targets(bool c)
support contracted targets?
Definition: default_params.h:165
Defaults definitions for various parameters assumed by Libint.
Definition: algebra.cc:24
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:328
const std::string & realtype() const
name of the floating-point type
Definition: default_params.h:98
void realtype(const std::string &realtype)
which floating-point type to use
Definition: default_params.h:161
This class maintains various parameters for each task type which can only be determined during the so...
Definition: default_params.h:265
unsigned int max_ntarget() const
returns the max number of targets
Definition: default_params.h:271
unsigned int num_bf(std::string t="") const
returns number of basis functions in integrals for task t
Definition: default_params.cc:128
static const char am_letters[num_am_letters+1]
am -> char conversion
Definition: default_params.h:363
static const unsigned int num_am_letters
basis functions with angular momenta 0 .
Definition: default_params.h:361
void accumulate_targets(bool a)
accumulate targets?
Definition: default_params.h:157
const std::string & api_prefix() const
the API prefix
Definition: default_params.h:74
bool use_C_linking() const
returns whether to use C-style linking
Definition: default_params.h:82
unsigned int max_stack_size(unsigned int am) const
returns max stack size needed for quantum numbers up to am
Definition: default_params.h:279
const std::string & default_task_name() const
default task name
Definition: default_params.h:106
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:114
unsigned int align_size() const
returns alignment size (in units of sizeof(LIBINT_FLOAT))
Definition: default_params.h:66
void print(std::ostream &os) const
print params out
Definition: default_params.cc:56
void max_vector_length(unsigned int a)
set max vector length
Definition: default_params.h:117
unsigned int max_vector_stack_size(unsigned int am) const
returns max vector stack size.
Definition: default_params.h:286
void default_task_name(const std::string &s)
default task name
Definition: default_params.h:169
CompilationParameters()
Use default parameters.
Definition: default_params.cc:34
void use_C_linking(bool a)
set whether to use C style linking
Definition: default_params.h:145
void profile(bool a)
set to instrument profiling
Definition: default_params.h:153
bool contracted_targets() const
whether contracted targets are supported
Definition: default_params.h:102
bool single_evaltype() const
generate single evaluator type (i.e. not specific to each task)?
Definition: default_params.h:78
bool count_flops() const
whether FLOP counting is enabled
Definition: default_params.h:86
unsigned int max_vector_length() const
returns max vector length
Definition: default_params.h:54
void align_size(unsigned int a)
set alignment size (in units of sizeof(LIBINT_FLOAT))
Definition: default_params.h:125
unsigned int unroll_threshold() const
returns unroll threshold
Definition: default_params.h:62
bool accumulate_targets() const
whether target integrals are accumulated
Definition: default_params.h:94
void api_prefix(const std::string &a)
API prefix.
Definition: default_params.h:137
unsigned int max_hrr_lsrank(unsigned int am) const
returns max rank of low-significance functions in a HRR call.
Definition: default_params.h:304
void count_flops(bool a)
set whether to count FLOPs
Definition: default_params.h:149
These are the parameters received by the compiler.
Definition: default_params.h:38
unsigned int max_am() const
returns the max quantum number of targets
Definition: default_params.h:275
void max_ntarget(unsigned int ntarget)
if max_ntarget_ < ntarget then set max_ntarget_=ntarget
Definition: default_params.h:312