29 #ifndef PIRANHA_TUNING_HPP 30 #define PIRANHA_TUNING_HPP 35 #include <piranha/config.hpp> 37 #include <piranha/runtime_info.hpp> 45 template <
typename =
int>
47 static std::atomic<bool> s_parallel_memory_set;
48 static std::atomic<unsigned long> s_mult_block_size;
49 static std::atomic<unsigned long> s_estimate_threshold;
53 std::atomic<bool> base_tuning<T>::s_parallel_memory_set(
true);
56 std::atomic<unsigned long> base_tuning<T>::s_mult_block_size(256u);
59 std::atomic<unsigned long> base_tuning<T>::s_estimate_threshold(200u);
67 class tuning :
private detail::base_tuning<>
83 return s_parallel_memory_set.load();
93 s_parallel_memory_set.store(flag);
103 s_parallel_memory_set.store(
true);
119 return s_mult_block_size.load();
131 if (unlikely(size < 16u || size > 4096u)) {
134 s_mult_block_size.store(size);
144 s_mult_block_size.store(256u);
161 return s_estimate_threshold.load();
171 s_estimate_threshold.store(size);
181 s_estimate_threshold.store(200u);
static void reset_parallel_memory_set()
Reset the parallel_memory_set flag.
static void reset_estimate_threshold()
Reset the series estimation threshold.
static void set_estimate_threshold(unsigned long size)
Set the series estimation threshold.
static void set_parallel_memory_set(bool flag)
Set the parallel_memory_set flag.
#define piranha_throw(exception_type,...)
Exception-throwing macro.
static void set_multiplication_block_size(unsigned long size)
Set the multiplication block size.
static unsigned long get_estimate_threshold()
Get the series estimation threshold.
static void reset_multiplication_block_size()
Reset the multiplication block size.
static unsigned long get_multiplication_block_size()
Get the multiplication block size.
static bool get_parallel_memory_set()
Get the parallel_memory_set flag.