LAMA
/home/brandes/workspace/LAMA/src/lama/openmp/OpenMPCOOUtils.hpp
Go to the documentation of this file.
00001 
00033 #ifndef LAMA_OPENMP_COO_UTILS_HPP_
00034 #define LAMA_OPENMP_COO_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 // assert
00044 #include <lama/exception/LAMAAssert.hpp>
00045 
00046 // logging
00047 #include <logging/logging.hpp>
00048 
00049 namespace lama
00050 {
00051 
00058 class LAMA_DLL_IMPORTEXPORT OpenMPCOOUtils
00059 {
00060 public:
00061 
00064     static void getCSRSizes( IndexType csrSizes[],
00065                              const IndexType numRows,
00066                              const IndexType numValues,
00067                              const IndexType cooIA[] );
00068 
00071     template<typename COOValueType, typename  CSRValueType>
00072     static void getCSRValues( IndexType csrJA[],
00073                               CSRValueType csrValues[],
00074                               IndexType csrIA[],
00075                               const IndexType numRow,
00076                               const IndexType numValues,
00077                               const IndexType cooIA[],
00078                               const IndexType cooJA[],
00079                               const COOValueType cooValues[] );
00080 
00083     template<typename COOValueType, typename CSRValueType>
00084     static void setCSRValues( IndexType cooIA[],
00085                               IndexType cooJA[],
00086                               COOValueType cooValues[],
00087                               const IndexType numRows,
00088                               const IndexType numDiagonals,
00089                               const IndexType csrIA[],
00090                               const IndexType csrJA[],
00091                               const CSRValueType csrValues[],
00092                               const bool csrDiagonalProperty );
00093 
00096     template <typename ValueType>
00097     static void normalGEMV( ValueType result[],
00098                             const ValueType alpha,
00099                             const ValueType x[],
00100                             const ValueType beta,
00101                             const ValueType y[],
00102                             const IndexType numRows,
00103                             const IndexType cooIA[],
00104                             const IndexType cooJA[],
00105                             const ValueType cooValues[],
00106                             const IndexType numValues,
00107                             SyncToken* syncToken );
00108 
00111     template <typename ValueType>
00112     static void jacobi( ValueType* solution,
00113                         const IndexType cooNumValues,
00114                         const IndexType cooIA[],
00115                         const IndexType cooJA[],
00116                         const ValueType cooValues[],
00117                         const ValueType oldSolution[],
00118                         const ValueType rhs[],
00119                         const ValueType omega,
00120                         const IndexType numRows,
00121                         SyncToken* syncToken );
00122 
00125     static void setInterface( struct COOUtilsInterface& COOUtils );
00126 
00127 private:
00128 
00131     LAMA_LOG_DECL_STATIC_LOGGER( logger );
00132 };
00133 
00134 }  // namespace lama
00135 
00136 #endif //  LAMA_COO_STORAGE_UTILS_HPP_