vSMC
vSMC: Scalable Monte Carlo
Public Member Functions | Static Public Member Functions | List of all members
vsmc::CStringNonTemporalThreshold Class Reference

The threshold of buffer size above which memcpy use non-temporal instructions. More...

#include <vsmc/utility/cstring.hpp>

Public Member Functions

std::size_t get () const
 Get the threshold. More...
 
std::size_t max_level () const
 The maximum level of cache considered in set(). More...
 
void max_level (std::size_t level)
 Set new maximum level of cache considered in set(). More...
 
unsigned over (std::size_t n) const
 Give number of bytes, return flag indicate if it is over the threshold. More...
 
void set ()
 Set the threshold to default. More...
 
void set (std::size_t threshold)
 Set the threshold to a specific size. More...
 

Static Public Member Functions

static CStringNonTemporalThresholdinstance ()
 Singleton instance. More...
 

Detailed Description

The threshold of buffer size above which memcpy use non-temporal instructions.

Definition at line 578 of file cstring.hpp.

Member Function Documentation

std::size_t vsmc::CStringNonTemporalThreshold::get ( ) const
inline

Get the threshold.

Definition at line 628 of file cstring.hpp.

static CStringNonTemporalThreshold& vsmc::CStringNonTemporalThreshold::instance ( )
inlinestatic

Singleton instance.

Note
If any memcpy functions in this module is to be called from multiple thread, then this member function need to be called at least once before entering threads.

Definition at line 587 of file cstring.hpp.

std::size_t vsmc::CStringNonTemporalThreshold::max_level ( ) const
inline

The maximum level of cache considered in set().

Definition at line 595 of file cstring.hpp.

void vsmc::CStringNonTemporalThreshold::max_level ( std::size_t  level)
inline

Set new maximum level of cache considered in set().

Note
This will automatically call set() to set the new threshold.

Definition at line 601 of file cstring.hpp.

unsigned vsmc::CStringNonTemporalThreshold::over ( std::size_t  n) const
inline

Give number of bytes, return flag indicate if it is over the threshold.

Definition at line 632 of file cstring.hpp.

void vsmc::CStringNonTemporalThreshold::set ( )
inline

Set the threshold to default.

By default, we set a pretty high threshold (the LLC size).

Definition at line 607 of file cstring.hpp.

void vsmc::CStringNonTemporalThreshold::set ( std::size_t  threshold)
inline

Set the threshold to a specific size.

Definition at line 625 of file cstring.hpp.