LAMA
/home/brandes/workspace/LAMA/src/lama/openmp/OpenMPDIAUtils.hpp
Go to the documentation of this file.
00001 
00033 #ifndef LAMA_OPENMP_DIA_UTILS_HPP_
00034 #define LAMA_OPENMP_DIA_UTILS_HPP_
00035 
00036 // for dll_import
00037 #include <lama/config.hpp>
00038 
00039 // others
00040 #include <lama/LAMATypes.hpp>
00041 #include <lama/SyncToken.hpp>
00042 
00043 namespace lama
00044 {
00045 
00049 class LAMA_DLL_IMPORTEXPORT OpenMPDIAUtils
00050 {
00051 public:
00052 
00055     template<typename ValueType>
00056     static void getCSRSizes( IndexType csrSizes[],
00057                              bool diagonalFlag,
00058                              const IndexType numRows,
00059                              const IndexType numColumns,
00060                              const IndexType numDiagonals,
00061                              const IndexType diaOffsets[],
00062                              const ValueType diaValues[],
00063                              const ValueType eps );
00064 
00067     template<typename DIAValueType, typename CSRValueType>
00068     static void getCSRValues( IndexType csrJA[],
00069                               CSRValueType csrValues[],
00070                               const IndexType csrIA[],
00071                               const bool diagonalFlag,
00072                               const IndexType numRows,
00073                               const IndexType numColumns,
00074                               const IndexType numDiagonals,
00075                               const IndexType diaOffsets[],
00076                               const DIAValueType diaValues[],
00077                               const DIAValueType eps );
00078 
00081     template <typename ValueType>
00082     static void normalGEMV( ValueType result[],
00083                             const ValueType alpha,
00084                             const ValueType x[],
00085                             const ValueType beta,
00086                             const ValueType y[],
00087                             const IndexType numRows,
00088                             const IndexType numColumns,
00089                             const IndexType numDiagonals,
00090                             const IndexType diaOffsets[],
00091                             const ValueType diaValues[],
00092                             SyncToken* syncToken );
00093 
00096     template <typename ValueType>
00097     static void jacobi( ValueType solution[],
00098                         const IndexType numColumns,
00099                         const IndexType numDiagonals,
00100                         const IndexType diaOffset[],
00101                         const ValueType diaValues[],
00102                         const ValueType oldSolution[],
00103                         const ValueType rhs[],
00104                         const ValueType omega,
00105                         const IndexType numRows,
00106                         SyncToken* syncToken );
00107 
00110     static void setInterface( struct DIAUtilsInterface& DIAUtils );
00111 
00112 private:
00113 
00114     template <typename ValueType>
00115     static void normalGEMV( ValueType result[],
00116                             const ValueType alpha,
00117                             const ValueType x[],
00118                             const ValueType beta,
00119                             const ValueType y[],
00120                             const IndexType numRows,
00121                             const IndexType numColumns,
00122                             const IndexType numDiagonals,
00123                             const IndexType diaOffsets[],
00124                             const ValueType diaValues[]  );
00125 
00126     LAMA_LOG_DECL_STATIC_LOGGER(logger);
00127 };
00128 
00129 }  // namespace lama
00130 
00131 #endif //  LAMA_OPENMP_DIA_UTILS_HPP_