piranha  0.10
Static Public Member Functions | List of all members
piranha::tuning Class Reference

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...
 

Detailed Description

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.

Member Function Documentation

◆ get_estimate_threshold()

static unsigned long piranha::tuning::get_estimate_threshold ( )
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.

Returns
the series estimation threshold.

Definition at line 159 of file tuning.hpp.

◆ get_multiplication_block_size()

static unsigned long piranha::tuning::get_multiplication_block_size ( )
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.

Returns
the block size used in some series multiplication routines.

Definition at line 117 of file tuning.hpp.

◆ get_parallel_memory_set()

static bool piranha::tuning::get_parallel_memory_set ( )
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).

Returns
current value of the parallel_memory_set flag.

Definition at line 81 of file tuning.hpp.

◆ reset_estimate_threshold()

static void piranha::tuning::reset_estimate_threshold ( )
inlinestatic

Reset the series estimation threshold.

This method will reset the series estimation threshold to its default value.

See also
piranha::tuning::get_estimate_threshold() for an explanation of the meaning of this value.

Definition at line 179 of file tuning.hpp.

◆ reset_multiplication_block_size()

static void piranha::tuning::reset_multiplication_block_size ( )
inlinestatic

Reset the multiplication block size.

This method will reset the multiplication block size to its default value.

See also
piranha::tuning::get_multiplication_block_size() for an explanation of the meaning of this value.

Definition at line 142 of file tuning.hpp.

◆ reset_parallel_memory_set()

static void piranha::tuning::reset_parallel_memory_set ( )
inlinestatic

Reset the parallel_memory_set flag.

This method will reset the parallel_memory_set flag to its default value.

See also
piranha::tuning::get_parallel_memory_set() for an explanation of the meaning of this flag.

Definition at line 101 of file tuning.hpp.

◆ set_estimate_threshold()

static void piranha::tuning::set_estimate_threshold ( unsigned long  size)
inlinestatic

Set the series estimation threshold.

See also
piranha::tuning::s_estimate_threshold() for an explanation of the meaning of this value.
Parameters
sizedesired value for the series estimation threshold.

Definition at line 169 of file tuning.hpp.

◆ set_multiplication_block_size()

static void piranha::tuning::set_multiplication_block_size ( unsigned long  size)
inlinestatic

Set the multiplication block size.

See also
piranha::tuning::get_multiplication_block_size() for an explanation of the meaning of this value.
Parameters
sizedesired value for the block size.
Exceptions
std::invalid_argumentif size is outside an implementation-defined range.

Definition at line 129 of file tuning.hpp.

◆ set_parallel_memory_set()

static void piranha::tuning::set_parallel_memory_set ( bool  flag)
inlinestatic

Set the parallel_memory_set flag.

See also
piranha::tuning::get_parallel_memory_set() for an explanation of the meaning of this flag.
Parameters
flagdesired value for the parallel_memory_set flag.

Definition at line 91 of file tuning.hpp.


The documentation for this class was generated from the following file: