LAMA
lama::HostReadAccess< T > Class Template Reference

HostReadAccess is a specialization of ReadAccess for a Host context with an extended interface. More...

#include <HostReadAccess.hpp>

Inheritance diagram for lama::HostReadAccess< T >:

Public Types

typedef T ValueType
 ValueType is the type stored in the wrapped container.

Public Member Functions

 HostReadAccess (const LAMAArray< ValueType > &array)
 acquire a ReadAccess to the passed LAMAArray for the Host Location
 HostReadAccess (const LAMAArrayConstView< ValueType > &view)
virtual ~HostReadAccess ()
 Releases the ReadAccess on the associated LAMAArray.
const ValueTypeoperator[] (const IndexType i) const
 constant access to the element i of the wrapped LAMAArray
 operator const ValueType * () const
 conversion to a constant ValueType pointer (shortcut for get() )
const ValueTypeget () const
 returns a valid pointer to the data usable for the context
virtual void release ()
 release the acquired ReadAccess.
virtual void writeAt (std::ostream &stream) const
 Writes some Information about this to the passed stream.
IndexType size () const
 Returns the size of the array.

Private Member Functions

 LAMA_LOG_DECL_STATIC_LOGGER (logger)

Private Attributes

const ValueType *const mData

Detailed Description

template<typename T>
class lama::HostReadAccess< T >

HostReadAccess is a specialization of ReadAccess for a Host context with an extended interface.


Member Typedef Documentation

template<typename T>
typedef T lama::HostReadAccess< T >::ValueType

ValueType is the type stored in the wrapped container.

Reimplemented from lama::ReadAccess< T >.


Constructor & Destructor Documentation

template<typename T >
lama::HostReadAccess< T >::HostReadAccess ( const LAMAArray< ValueType > &  array)

acquire a ReadAccess to the passed LAMAArray for the Host Location

Parameters:
[in]arraythe LAMAArray to acquire a ReadAccess for
Exceptions:
Exceptionif the ReadAccess can not be acquired, e.g. because a WriteContext exists.

References lama::HostReadAccess< T >::mData.

template<typename T >
lama::HostReadAccess< T >::HostReadAccess ( const LAMAArrayConstView< ValueType > &  view)
template<typename T >
lama::HostReadAccess< T >::~HostReadAccess ( ) [virtual]

Releases the ReadAccess on the associated LAMAArray.


Member Function Documentation

template<typename T >
const T * lama::ReadAccess< T >::get ( ) const [inherited]

returns a valid pointer to the data usable for the context

Returns:
a pointer to the wrapped LAMAArray.

References LAMA_THROWEXCEPTION.

Referenced by lama::DenseVector< T >::assign(), lama::LAMAArrayUtils::assignImpl2(), lama::SparseMatrix< T >::assignTransposeImpl(), lama::COOStorage< T >::buildCSR(), lama::ELLStorage< T >::buildCSR(), lama::JDSStorage< T >::buildCSR(), lama::DIAStorage< T >::buildCSR(), lama::DenseStorageView< T >::buildCSR(), lama::CSRStorage< T >::buildCSR(), lama::ELLStorage< T >::buildRowIndexes(), lama::CSRStorage< T >::buildRowIndexes(), lama::ELLStorage< T >::check(), lama::JDSStorage< T >::check(), lama::JDSStorage< T >::checkDiagonalProperty(), lama::ELLStorage< T >::checkDiagonalProperty(), lama::CSRStorage< T >::checkDiagonalProperty(), lama::ELLStorage< T >::compress(), lama::LUSolver::computeLUFactorization(), lama::MatrixStorage< T >::convertCSR2CSC(), lama::DenseVector< T >::dotProduct(), lama::Communicator::exchangeByPlan(), lama::StorageMethods< T >::exchangeHaloCSR(), lama::LAMAArrayUtils::gather(), lama::COOStorage< T >::getDiagonalImpl(), lama::ELLStorage< T >::getDiagonalImpl(), lama::CSRStorage< T >::getDiagonalImpl(), lama::DenseStorageView< T >::getDiagonalImpl(), lama::DIAStorage< T >::getDiagonalImpl(), lama::JDSStorage< T >::getDiagonalImpl(), lama::ELLStorage< T >::getNumValues(), lama::_MatrixStorage::getNumValues(), lama::ELLStorage< T >::getRowImpl(), lama::JDSStorage< T >::getRowImpl(), lama::ELLStorage< T >::getValue(), lama::JDSStorage< T >::getValue(), lama::JDSStorage< T >::jacobiIterate(), lama::DIAStorage< T >::jacobiIterate(), lama::COOStorage< T >::jacobiIterate(), lama::ELLStorage< T >::jacobiIterate(), lama::CSRStorage< T >::jacobiIterate(), lama::JDSStorage< T >::jacobiIterateHalo(), lama::ELLStorage< T >::jacobiIterateHalo(), lama::CSRStorage< T >::jacobiIterateHalo(), lama::MatrixStorage< T >::joinRows(), lama::DenseVector< T >::l1Norm(), lama::DenseVector< T >::l2Norm(), lama::ELLStorage< T >::matrixAddMatrixELL(), lama::DenseStorageView< T >::matrixTimesMatrixDense(), lama::ELLStorage< T >::matrixTimesMatrixELL(), lama::JDSStorage< T >::matrixTimesVector(), lama::DIAStorage< T >::matrixTimesVector(), lama::DenseStorageView< T >::matrixTimesVector(), lama::COOStorage< T >::matrixTimesVector(), lama::ELLStorage< T >::matrixTimesVector(), lama::CSRStorage< T >::matrixTimesVector(), lama::CSRStorage< T >::matrixTimesVectorN(), lama::DenseStorageView< T >::maxDiffNormImpl(), lama::CSRStorage< T >::maxDiffNormImpl(), lama::DenseVector< T >::maxNorm(), lama::DenseStorageView< T >::print(), lama::LUSolver::ptrsm(), lama::DenseVector< T >::redistribute(), lama::StorageMethods< T >::redistributeCSR(), lama::StorageMethods< T >::replicateCSR(), lama::JDSStorage< T >::scaleImpl(), lama::ELLStorage< T >::scaleImpl(), lama::CSRStorage< T >::scaleImpl(), lama::DenseStorageView< T >::setCSRDataImpl(), lama::CSRStorage< T >::setCSRDataImpl(), lama::COOStorage< T >::setCSRDataImpl(), lama::JDSStorage< T >::setCSRDataImpl(), lama::ELLStorage< T >::setCSRDataImpl(), lama::SparseAssemblyStorage< T >::setCSRDataImpl(), lama::DIAStorage< T >::setCSRDataImpl(), lama::CSRStorage< T >::setCSRDataSwap(), lama::COOStorage< T >::setDiagonalImpl(), lama::ELLStorage< T >::setDiagonalImpl(), lama::CSRStorage< T >::setDiagonalImpl(), lama::JDSStorage< T >::setDiagonalImpl(), lama::DIAStorage< T >::setDiagonalImpl(), lama::DenseStorageView< T >::setDiagonalImpl(), lama::JDSStorage< T >::setupData(), lama::Communicator::shift(), lama::DenseVector< T >::vectorPlusVector(), lama::StorageIO< T >::writeCSRToBinaryFile(), lama::StorageIO< T >::writeCSRToXDRFile(), lama::DenseVector< T >::writeVectorDataToBinaryFile(), and lama::DenseVector< T >::writeVectorToXDRFile().

template<typename T>
lama::HostReadAccess< T >::LAMA_LOG_DECL_STATIC_LOGGER ( logger  ) [private]

Reimplemented from lama::ReadAccess< T >.

template<typename T>
lama::HostReadAccess< T >::operator const ValueType * ( ) const [inline]

conversion to a constant ValueType pointer (shortcut for get() )

Returns:
a constant pointer to the data of the wrapped LAMAArray
template<typename T >
const T & lama::HostReadAccess< T >::operator[] ( const IndexType  i) const [inline]

constant access to the element i of the wrapped LAMAArray

Parameters:
[in]ithe index of the element of the wrapped LAMAArray to access
Returns:
a constant reference to the element i of the wrapped LAMAArray
template<typename T >
void lama::ReadAccess< T >::release ( ) [virtual, inherited]

release the acquired ReadAccess.

Release is mandatory to unlock the array so that it might be used for further write accesses.

Implements lama::BaseAccess.

Referenced by lama::CSRStorage< T >::compress(), and lama::StorageMethods< T >::exchangeHaloCSR().

template<typename T >
void lama::ReadAccess< T >::writeAt ( std::ostream &  stream) const [virtual, inherited]

Writes some Information about this to the passed stream.

If a deriving class does not overrides writeAt, typeid(this).name() is written to stream.

Parameters:
[out]streamthe stream to write to.

Reimplemented from lama::BaseAccess.


Field Documentation

template<typename T>
const ValueType* const lama::HostReadAccess< T >::mData [private]

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