Anasazi Version of the Day
Public Member Functions
TSQR::CacheBlockingStrategy< LocalOrdinal, Scalar > Class Template Reference

#include <Tsqr_CacheBlockingStrategy.hpp>

List of all members.

Public Member Functions

 CacheBlockingStrategy (const size_t cacheBlockSize=0)
 CacheBlockingStrategy (const CacheBlockingStrategy &rhs)
CacheBlockingStrategyoperator= (const CacheBlockingStrategy &rhs)
size_t cache_block_size () const
bool operator== (const CacheBlockingStrategy &rhs) const
bool operator!= (const CacheBlockingStrategy &rhs) const
std::pair< LocalOrdinal,
LocalOrdinal > 
cache_block (const LocalOrdinal index, const LocalOrdinal nrows, const LocalOrdinal ncols, const LocalOrdinal nrows_cache_block) const
LocalOrdinal num_cache_blocks (const LocalOrdinal nrows, const LocalOrdinal ncols, const LocalOrdinal nrows_cache_block) const
LocalOrdinal top_block_split_nrows (const LocalOrdinal nrows, const LocalOrdinal ncols, const LocalOrdinal nrows_cache_block) const
LocalOrdinal bottom_block_split_nrows (const LocalOrdinal nrows, const LocalOrdinal ncols, const LocalOrdinal nrows_cache_block) const
size_t default_cache_block_size (const size_t suggested_cache_size) const
LocalOrdinal cache_block_num_rows (const LocalOrdinal ncols) const

Detailed Description

template<class LocalOrdinal, class Scalar>
class TSQR::CacheBlockingStrategy< LocalOrdinal, Scalar >

Strategy object that helps CacheBlocker decide how to block up a given multivector.

Definition at line 48 of file Tsqr_CacheBlockingStrategy.hpp.


Constructor & Destructor Documentation

template<class LocalOrdinal, class Scalar>
TSQR::CacheBlockingStrategy< LocalOrdinal, Scalar >::CacheBlockingStrategy ( const size_t  cacheBlockSize = 0) [inline]

Constructor

Parameters:
cacheBlockSize[in] Cache block size in bytes. If zero, the cache block size is set to a reasonable default.

Definition at line 54 of file Tsqr_CacheBlockingStrategy.hpp.

template<class LocalOrdinal, class Scalar>
TSQR::CacheBlockingStrategy< LocalOrdinal, Scalar >::CacheBlockingStrategy ( const CacheBlockingStrategy< LocalOrdinal, Scalar > &  rhs) [inline]

Copy constructor

Definition at line 61 of file Tsqr_CacheBlockingStrategy.hpp.


Member Function Documentation

template<class LocalOrdinal, class Scalar>
CacheBlockingStrategy& TSQR::CacheBlockingStrategy< LocalOrdinal, Scalar >::operator= ( const CacheBlockingStrategy< LocalOrdinal, Scalar > &  rhs) [inline]

Assignment operator

Definition at line 68 of file Tsqr_CacheBlockingStrategy.hpp.

template<class LocalOrdinal, class Scalar>
size_t TSQR::CacheBlockingStrategy< LocalOrdinal, Scalar >::cache_block_size ( ) const [inline]

Return the cache block size in bytes

Definition at line 76 of file Tsqr_CacheBlockingStrategy.hpp.

template<class LocalOrdinal, class Scalar>
bool TSQR::CacheBlockingStrategy< LocalOrdinal, Scalar >::operator== ( const CacheBlockingStrategy< LocalOrdinal, Scalar > &  rhs) const [inline]

Return true if the two strategies are the same

Note:
Currently this means only that they use the same cache block size.

Definition at line 82 of file Tsqr_CacheBlockingStrategy.hpp.

template<class LocalOrdinal, class Scalar>
bool TSQR::CacheBlockingStrategy< LocalOrdinal, Scalar >::operator!= ( const CacheBlockingStrategy< LocalOrdinal, Scalar > &  rhs) const [inline]

Return true if the two strategies are not the same

Note:
Currently this means only that they use different cache block sizes.

Definition at line 90 of file Tsqr_CacheBlockingStrategy.hpp.

template<class LocalOrdinal, class Scalar>
std::pair< LocalOrdinal, LocalOrdinal > TSQR::CacheBlockingStrategy< LocalOrdinal, Scalar >::cache_block ( const LocalOrdinal  index,
const LocalOrdinal  nrows,
const LocalOrdinal  ncols,
const LocalOrdinal  nrows_cache_block 
) const [inline]
Returns:
Row start index (zero-based) of my cache block, and the number of rows in my cache block. If the index is out of range, the row start index will be nrows and the number of rows will be zero.

Definition at line 99 of file Tsqr_CacheBlockingStrategy.hpp.

template<class LocalOrdinal, class Scalar>
LocalOrdinal TSQR::CacheBlockingStrategy< LocalOrdinal, Scalar >::num_cache_blocks ( const LocalOrdinal  nrows,
const LocalOrdinal  ncols,
const LocalOrdinal  nrows_cache_block 
) const [inline]

Number of cache blocks into which to break up an nrows by ncols matrix, where the suggested number of rows per cache block is nrows_cache_block, and where no cache block has fewer than ncols rows.

Definition at line 136 of file Tsqr_CacheBlockingStrategy.hpp.

template<class LocalOrdinal, class Scalar>
LocalOrdinal TSQR::CacheBlockingStrategy< LocalOrdinal, Scalar >::top_block_split_nrows ( const LocalOrdinal  nrows,
const LocalOrdinal  ncols,
const LocalOrdinal  nrows_cache_block 
) const [inline]

If we partition the nrows by ncols matrix A into [A_top; A_bot] with A_top being a cache block and A_bot being the rest of the matrix, return the number of rows that A_top should have.

Returns:
# of rows in top cache block A_top

Definition at line 154 of file Tsqr_CacheBlockingStrategy.hpp.

template<class LocalOrdinal, class Scalar>
LocalOrdinal TSQR::CacheBlockingStrategy< LocalOrdinal, Scalar >::bottom_block_split_nrows ( const LocalOrdinal  nrows,
const LocalOrdinal  ncols,
const LocalOrdinal  nrows_cache_block 
) const [inline]

If we partition the nrows by ncols matrix A into [A_top; A_bot] with A_bot being a cache block and A_top being the rest of the matrix, return the number of rows that A_bot should have.

Returns:
# of rows in top cache block A_bot

Definition at line 179 of file Tsqr_CacheBlockingStrategy.hpp.

template<class LocalOrdinal, class Scalar>
size_t TSQR::CacheBlockingStrategy< LocalOrdinal, Scalar >::default_cache_block_size ( const size_t  suggested_cache_size) const [inline]

Return the cache block size in bytes, based on the given suggested size in bytes, and the size of the Scalar type. If the input is zero, return a reasonable default size.

Returns:
Either the given suggested cache block size (in bytes), or a default cache block size (in bytes) (if the given suggested size == 0).

Definition at line 222 of file Tsqr_CacheBlockingStrategy.hpp.

template<class LocalOrdinal, class Scalar>
LocalOrdinal TSQR::CacheBlockingStrategy< LocalOrdinal, Scalar >::cache_block_num_rows ( const LocalOrdinal  ncols) const [inline]

Number of rows that a cache block should occupy, given a particular number of columns in the matrix to factor. That cache block size is used to fix the number of rows per cache block also when applying Q to a matrix C. We choose the cache block size so that when Q and C have the same number of columns, two cache blocks (one of Q and the other of C) will fit in cache.

Parameters:
ncols[in] Number of columns in the matrix whose QR factorization we compute using SequentialTsqr.

Definition at line 279 of file Tsqr_CacheBlockingStrategy.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends