SpatialLocality Class Reference

#include <ReuseDistance.hpp>

Inheritance diagram for SpatialLocality:
ReuseDistance

List of all members.

Public Member Functions

 SpatialLocality (uint64_t w, uint64_t b, uint64_t n)
 SpatialLocality (uint64_t w, uint64_t b)
 SpatialLocality (uint64_t w)
 SpatialLocality ()
virtual ~SpatialLocality ()
virtual void GetActiveAddresses (std::vector< uint64_t > &addrs)
virtual void Process (ReuseEntry &addr)
virtual void SkipAddresses (uint64_t amount)

Static Public Attributes

static const uint64_t DefaultWindowSize = 64

Detailed Description

Finds and tracks spatial locality within a memory address stream. Spatial locality is defined as the minimum distance between the current address and any of the previous N addresses, as in http://www.sdsc.edu/~allans/sc05_locality.pdf. This class allows that window size N to be customized. For basic usage, see the documentation at http://bit.ly/ScqZVj for the constructors, the Process methods and the Print methods. Also see the simple test file test/test.cpp included in this source package.

Definition at line 388 of file ReuseDistance.hpp.


Constructor & Destructor Documentation

SpatialLocality::SpatialLocality ( uint64_t  w,
uint64_t  b,
uint64_t  n 
) [inline]

Contructs a ReuseDistance object.

Parameters:
w The maximum window size, which is the maximum number of addresses that will be searched for spatial locality. w != ReuseDistance::Infinity is enforced at runtime.
b All distances not greater than b will be tracked individually. All distances are tracked individually if b == ReuseDistance::Infinity. Beyond individual tracking, distances are tracked in bins whose boundaries are the powers of two greater than b and not greater than n.
n All distances greater than n will be counted as infinite. Use n == ReuseDistance::Infinity for no limit. n >= b is enforced at runtime.

Definition at line 420 of file ReuseDistance.hpp.

SpatialLocality::SpatialLocality ( uint64_t  w,
uint64_t  b 
) [inline]

Constructs a SpatialLocality object. Equivalent to calling the other 3-argument constructor with n == ReuseDistance::Infinity

Definition at line 426 of file ReuseDistance.hpp.

SpatialLocality::SpatialLocality ( uint64_t  w  )  [inline]

Constructs a SpatialLocality object. Equivalent to calling the other 3-argument constructor with w == b and n == ReuseDistance::Infinity

Definition at line 432 of file ReuseDistance.hpp.

SpatialLocality::SpatialLocality (  )  [inline]

Constructs a SpatialLocality object. Equivalent to calling the other 3-argument constructor with w == b == SpatialLocality::DefaultWindowSize and n == ReuseDistance::Infinity

Definition at line 438 of file ReuseDistance.hpp.

virtual SpatialLocality::~SpatialLocality (  )  [inline, virtual]

Destroys a SpatialLocality object.

Definition at line 443 of file ReuseDistance.hpp.


Member Function Documentation

void SpatialLocality::GetActiveAddresses ( std::vector< uint64_t > &  addrs  )  [virtual]

Get a std::vector containing all of the addresses currently in this SpatialLocality object's active window.

Parameters:
addrs A std::vector which will contain the addresses. It is an error to pass this vector non-empty (that is addrs.size() == 0 is enforced at runtime).
Returns:
none

Reimplemented from ReuseDistance.

Definition at line 460 of file ReuseDistance.cpp.

void SpatialLocality::Process ( ReuseEntry addr  )  [virtual]

Process a single memory address.

Parameters:
addr The structure describing the memory address to process.
Returns:
none

Reimplemented from ReuseDistance.

Definition at line 389 of file ReuseDistance.cpp.

void SpatialLocality::SkipAddresses ( uint64_t  amount  )  [virtual]

Pretend that some number of addresses in the stream were skipped. Useful for intervel-based sampling. This has the effect of flushing the entire window.

Parameters:
amount The number of addresses to skip.
Returns:
none

Reimplemented from ReuseDistance.

Definition at line 441 of file ReuseDistance.cpp.


Member Data Documentation

const uint64_t SpatialLocality::DefaultWindowSize = 64 [static]

Definition at line 407 of file ReuseDistance.hpp.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Defines
Generated on Sun Oct 21 14:56:28 2012 for ReuseDistance by  doxygen 1.6.3