piranha
0.10
|
Performance tuning. More...
#include <piranha/tuning.hpp>
Inherits piranha::detail::base_tuning<>.
Static Public Member Functions | |
static bool | get_parallel_memory_set () |
Get the parallel_memory_set flag. More... | |
static void | set_parallel_memory_set (bool flag) |
Set the parallel_memory_set flag. More... | |
static void | reset_parallel_memory_set () |
Reset the parallel_memory_set flag. More... | |
static unsigned long | get_multiplication_block_size () |
Get the multiplication block size. More... | |
static void | set_multiplication_block_size (unsigned long size) |
Set the multiplication block size. More... | |
static void | reset_multiplication_block_size () |
Reset the multiplication block size. More... | |
static unsigned long | get_estimate_threshold () |
Get the series estimation threshold. More... | |
static void | set_estimate_threshold (unsigned long size) |
Set the series estimation threshold. More... | |
static void | reset_estimate_threshold () |
Reset the series estimation threshold. More... | |
Performance tuning.
This class provides static methods to manipulate global variables useful for performance tuning. All the methods in this class are thread-safe.
Definition at line 67 of file tuning.hpp.
|
inlinestatic |
Get the series estimation threshold.
In series multiplication it can be advantageous to employ a heuristic to estimate the final size of the result before actually performing the multiplication. The cost of estimation is proportionally larger for small operands, and it can result in noticeable overhead for small multiplications. This flag establishes a threshold below which the estimation of the size of the product of a series multiplication will not be performed.
The precise way in which this value is used depends on the multiplication algorithm. The default value of this flag is 200.
Definition at line 159 of file tuning.hpp.
|
inlinestatic |
Get the multiplication block size.
The multiplication algorithms for certain series types (e.g., polynomials) divide the input operands in blocks before processing them. This flag regulates the maximum size of these blocks.
Larger block have less overhead, but can degrade the performance of memory access. Smaller blocks can promote faster memory access but can also incur in larger overhead.
The default value of this flag is 256.
Definition at line 117 of file tuning.hpp.
|
inlinestatic |
Get the parallel_memory_set
flag.
Piranha can use multiple threads when initialising large memory areas (e.g., during the initialisation of the result of the multiplication of two large polynomials). This can improve performance on systems with fast or multiple memory buses, but it could lead to degraded performance on slower/single-socket machines.
The default value of this flag is true
(i.e., Piranha will use multiple threads while initialising large memory areas).
parallel_memory_set
flag. Definition at line 81 of file tuning.hpp.
|
inlinestatic |
Reset the series estimation threshold.
This method will reset the series estimation threshold to its default value.
Definition at line 179 of file tuning.hpp.
|
inlinestatic |
Reset the multiplication block size.
This method will reset the multiplication block size to its default value.
Definition at line 142 of file tuning.hpp.
|
inlinestatic |
Reset the parallel_memory_set
flag.
This method will reset the parallel_memory_set
flag to its default value.
Definition at line 101 of file tuning.hpp.
|
inlinestatic |
Set the series estimation threshold.
size | desired value for the series estimation threshold. |
Definition at line 169 of file tuning.hpp.
|
inlinestatic |
Set the multiplication block size.
size | desired value for the block size. |
std::invalid_argument | if size is outside an implementation-defined range. |
Definition at line 129 of file tuning.hpp.
|
inlinestatic |
Set the parallel_memory_set
flag.
flag | desired value for the parallel_memory_set flag. |
Definition at line 91 of file tuning.hpp.