LAMA
/home/brandes/workspace/LAMA/src/lama/LAMAInterface.hpp File Reference

Interface class for Matrix-Vector operations to be implemented. More...

#include <lama/config.hpp>
#include <lama/Printable.hpp>
#include <lama/Scalar.hpp>
#include <lama/SyncToken.hpp>

Go to the source code of this file.

Data Structures

struct  lama::BLAS1Interface< T >
struct  lama::BLAS2Interface< T >
struct  lama::BLAS3Interface< T >
struct  lama::LAPACKInterface< T >
 Structure with pointers for routines using LAPACK. More...
struct  lama::SCALAPACKInterface< T >
struct  lama::UtilsInterface
 Structure with pointers for all Utils methods. More...
struct  lama::UtilsInterface::Indexes
 Structure with type definitions for methods on indexes. More...
struct  lama::UtilsInterface::Reductions< ValueType >
 Structure with type defintions for all reduction methods. More...
struct  lama::UtilsInterface::Setter< ValueType >
struct  lama::UtilsInterface::Getter< ValueType >
struct  lama::UtilsInterface::Copy< ValueType1, ValueType2 >
struct  lama::UtilsInterface::Math< ValueType >
struct  lama::UtilsInterface::Transform< ValueType, OtherValueType >
struct  lama::CSRUtilsInterface
 Interface for utility functions to be used in CSR storage. More...
struct  lama::CSRUtilsInterface::Operations< ValueType >
 Structure with type definitions for spmv. More...
struct  lama::CSRUtilsInterface::Solver< ValueType >
 Structure with type definitions for solver routines. More...
struct  lama::CSRUtilsInterface::Offsets
 Structure with type definitions for offset routines. More...
struct  lama::CSRUtilsInterface::Transpose< ValueType >
 Define structure that contains type definitions for the function pointers. More...
struct  lama::CSRUtilsInterface::Scale< ValueType1, ValueType2 >
 Define structure for multiplication routines. More...
struct  lama::CSRUtilsInterface::Reductions< ValueType >
 Structure with type definitions for reduction routines. More...
struct  lama::CSRUtilsInterface::Mult< ValueType >
 Define structure for multiplication routines. More...
struct  lama::DenseUtilsInterface
 Interface for utility functions to be used in Dense storage. More...
struct  lama::DenseUtilsInterface::Counting< DenseValueType >
 Function pointer type definitions for dense storage. More...
struct  lama::DenseUtilsInterface::Conversions< DenseValueType, CSRValueType >
 Function pointer type definitions for conversion on dense storage. More...
struct  lama::DenseUtilsInterface::Copy< DenseValueType1, DenseValueType2 >
 Function pointer type definitions for copying on dense storage. More...
struct  lama::DenseUtilsInterface::Modify< DenseValueType >
 Function pointer type definitions for modification of dense storage. More...
struct  lama::DenseUtilsInterface::Mult< ValueType >
struct  lama::ELLUtilsInterface
 Interface for utility functions to be used in ELL storage. More...
struct  lama::ELLUtilsInterface::Solver< ValueType >
 Structure with type definitions for solver routines. More...
struct  lama::ELLUtilsInterface::Conversions< ELLValueType, CSRValueType >
 Conversion routines between ELL and CSR storage format. More...
struct  lama::ELLUtilsInterface::Helper< ValueType >
struct  lama::ELLUtilsInterface::Getter< ValueType, OtherValueType >
struct  lama::ELLUtilsInterface::Operations
struct  lama::ELLUtilsInterface::Mult< ValueType >
 Define structure for multiplication routines. More...
struct  lama::ELLUtilsInterface::Scale< ValueType, OtherValueType >
struct  lama::ELLUtilsInterface::MatrixTimesMatrix< ValueType >
struct  lama::JDSUtilsInterface
 Interface for utility functions to be used in JDS storage. More...
struct  lama::JDSUtilsInterface::Solver< ValueType >
 Structure with type definitions for solver routines. More...
struct  lama::JDSUtilsInterface::Sort
struct  lama::JDSUtilsInterface::Conversions< JDSValueType, CSRValueType >
struct  lama::JDSUtilsInterface::Mult< ValueType >
struct  lama::JDSUtilsInterface::Operations< ValueType >
struct  lama::JDSUtilsInterface::Getter< ValueType, OtherValueType >
struct  lama::JDSUtilsInterface::Scale< ValueType, OtherValueType >
struct  lama::JDSUtilsInterface::Helper
struct  lama::DIAUtilsInterface
 Interface for utility functions to be used in DIA storage. More...
struct  lama::DIAUtilsInterface::Counting< ValueType >
struct  lama::DIAUtilsInterface::Conversions< DIAValueType, CSRValueType >
struct  lama::DIAUtilsInterface::Mult< ValueType >
struct  lama::DIAUtilsInterface::Solver< ValueType >
 Structure with type definitions for solver routines. More...
struct  lama::COOUtilsInterface
 Interface for utility functions to be used in COO storage. More...
struct  lama::COOUtilsInterface::Counting
struct  lama::COOUtilsInterface::Conversions< COOValueType, CSRValueType >
struct  lama::COOUtilsInterface::Mult< ValueType >
struct  lama::COOUtilsInterface::Solver< ValueType >
 Structure with type definitions for solver routines. More...
class  lama::LAMAInterface
 LAMAInterface is the abstract class for Matrix-Vector operations. More...

Namespaces

namespace  lama
 

The namespace lama holds everything of the C++ Library lama.


Defines

#define LAMA_INTERFACE_DEFINE(structname, functionname)
 Macro that creates for a function pointer type a table that contains pointer for each type.
#define LAMA_INTERFACE_DEFINE_T(structname, functionname)
#define LAMA_INTERFACE_DEFINE_TT(structname, functionname)
#define LAMA_INTERFACE_INIT(functionname)   functionname##_Table = NULL;
 This macro intializes type table with of function will NULL function pointers.
#define LAMA_INTERFACE_INIT_T(functionname)
#define LAMA_INTERFACE_INIT_TT(functionname)
#define LAMA_INTERFACE_REGISTER(interface, function)   interface.function##_add( function );
#define LAMA_INTERFACE_REGISTER_T(interface, function, T)   interface.function##_add<T>( function<T> );
#define LAMA_INTERFACE_REGISTER_TT(interface, function, T1, T2)   interface.function##_add<T1,T2>( function<T1,T2> );
#define LAMA_INTERFACE_FN(function, loc, module, structname)
#define LAMA_INTERFACE_FN_T(function, loc, module, structname, T)
#define LAMA_INTERFACE_FN_DEFAULT_T(function, loc, module, structname, T)
#define LAMA_INTERFACE_FN_TT(function, loc, module, structname, T1, T2)

Detailed Description

Interface class for Matrix-Vector operations to be implemented.

Author:
Jiri Kraus
Date:
27.04.2011 $Id$

Define Documentation

#define LAMA_INTERFACE_DEFINE (   structname,
  functionname 
)
Value:
\    \
                                                                                              \
    structname::functionname                                                                  \
    functionname () const                                                                     \
    {                                                                                         \
        return functionname##_Table;                                                          \
    }                                                                                         \
                                                                                              \                                     \
                                                                                              \
    void functionname##_add( structname::functionname functionPtr )                           \
    {                                                                                         \
        functionname##_Table = functionPtr;                                                   \
    }                                                                                         \
                                                                                              \
    structname::functionname functionname##_Table;

Macro that creates for a function pointer type a table that contains pointer for each type.

#define LAMA_INTERFACE_DEFINE_T (   structname,
  functionname 
)
Value:
\    \
                                                                                              \
    template<typename T>                                                                      \
    typename structname<T>::functionname                                                      \
    functionname () const                                                                     \
    {                                                                                         \
        return ( typename structname<T>::functionname )                                       \
               functionname##_Table[ Scalar::getType<T>() ];                                  \
    }                                                                                         \
                                                                                              \                                     \
                                                                                              \
    template<typename T>                                                                      \
    void functionname##_add( typename structname<T>::functionname functionPtr )               \
    {                                                                                         \
        functionname##_Table[ Scalar::getType<T>() ]                                          \
         = ( void (*) () ) functionPtr;                                                       \
    }                                                                                         \
                                                                                              \
    void ( *functionname##_Table[ Scalar::UNKNOWN ] ) ();
#define LAMA_INTERFACE_DEFINE_TT (   structname,
  functionname 
)
Value:
\    \
                                                                                              \
    template<typename T1, typename T2>                                                        \
    typename structname<T1, T2>::functionname                                                 \
    functionname () const                                                                     \
    {                                                                                         \
        return ( typename structname<T1,T2>::functionname )                                   \
               functionname##_Table[ Scalar::getType<T1>()][ Scalar::getType<T2>() ];         \
    }                                                                                         \
                                                                                              \                                     \
                                                                                              \
    template<typename T1, typename T2>                                                        \
    void functionname##_add( typename structname<T1, T2>::functionname functionPtr )          \
    {                                                                                         \
        functionname##_Table[ Scalar::getType<T1>() ][ Scalar::getType<T2>() ]                \
           = ( void (*) () ) functionPtr;                                                     \
    }                                                                                         \
                                                                                              \
    void ( *functionname##_Table[ Scalar::UNKNOWN ][ Scalar::UNKNOWN] ) ();
#define LAMA_INTERFACE_FN_DEFAULT_T (   function,
  loc,
  module,
  structname,
 
)
Value:
typename module##Interface::structname<T>::function function =                            \
       loc->getInterface().module.function<T>();                                              \
    if ( function == NULL )                                                                   \
    {                                                                                         \
        LAMA_UNSUPPORTED( "Method " #module "::" #function " not available on " << *loc );    \
        loc = ContextFactory::getContext( Context::Host );                                    \
        function = loc->getInterface().module.function<T>();                                  \
        if ( function == NULL )                                                               \
        {                                                                                     \
            LAMA_THROWEXCEPTION( "Method " #module "::" #function                             \
                                 " also not available on " << *loc );                         \
        }                                                                                     \
    }

Referenced by lama::COOStorage< T >::jacobiIterate(), lama::DenseStorageView< T >::maxDiffNormImpl(), lama::CSRStorage< T >::maxDiffNormImpl(), and lama::DenseVector< T >::maxNorm().

#define LAMA_INTERFACE_FN_T (   function,
  loc,
  module,
  structname,
 
)
Value:
typename module##Interface::structname<T>::function function;                             \
    function = loc->getInterface().module.function<T>();                                      \
    if ( function == NULL )                                                                   \
    {                                                                                         \
        LAMA_THROWEXCEPTION( "Method " #module "::" #function " not available on " << *loc ); \
    }

Referenced by lama::JDSStorage< T >::allocate(), lama::LAMAArrayUtils::assign(), lama::ELLStorage< T >::compress(), lama::MatrixStorage< T >::convertCSR2CSC(), lama::ELLStorage< T >::ELLStorage(), lama::ELLStorage< T >::getNumValues(), lama::DenseVector< T >::invert(), lama::JDSStorage< T >::jacobiIterate(), lama::ELLStorage< T >::jacobiIterate(), lama::CSRStorage< T >::jacobiIterate(), lama::JDSStorage< T >::jacobiIterateHalo(), lama::ELLStorage< T >::jacobiIterateHalo(), lama::CSRStorage< T >::jacobiIterateHalo(), lama::JDSStorage< T >::JDSStorage(), lama::ELLStorage< T >::matrixAddMatrixELL(), lama::DenseStorageView< T >::matrixTimesMatrixDense(), lama::ELLStorage< T >::matrixTimesMatrixELL(), lama::JDSStorage< T >::matrixTimesVector(), lama::DIAStorage< T >::matrixTimesVector(), lama::COOStorage< T >::matrixTimesVector(), lama::ELLStorage< T >::matrixTimesVector(), lama::CSRStorage< T >::matrixTimesVector(), lama::ELLStorage< T >::matrixTimesVectorAsync(), lama::CSRStorage< T >::matrixTimesVectorAsync(), lama::COOStorage< T >::matrixTimesVectorAsyncToDo(), lama::CSRStorage< T >::matrixTimesVectorN(), lama::ELLStorage< T >::setCSRDataImpl(), lama::JDSStorage< T >::setCSRDataImpl(), lama::ELLStorage< T >::setDiagonalImpl(), lama::JDSStorage< T >::setDiagonalImpl(), lama::ELLStorage< T >::setIdentity(), lama::JDSStorage< T >::setIdentity(), lama::JDSStorage< T >::setupData(), and lama::JDSStorage< T >::sortRows().

#define LAMA_INTERFACE_INIT (   functionname)    functionname##_Table = NULL;

This macro intializes type table with of function will NULL function pointers.

Macro can only be used within the interface itself

#define LAMA_INTERFACE_INIT_T (   functionname)
Value:
for ( int i = 0; i < Scalar::UNKNOWN; ++i )                                             \
    {                                                                                       \
        functionname##_Table[i] = NULL;                                                     \
    }                                                                                       \
#define LAMA_INTERFACE_INIT_TT (   functionname)
Value:
for ( int i = 0; i < Scalar::UNKNOWN; ++i )                                             \
    {                                                                                       \
        for ( int j = 0; j < Scalar::UNKNOWN; ++j )                                         \
        {                                                                                   \
            functionname##_Table[i][j] = NULL;                                              \
        }                                                                                   \
    }                                                                                       \