PARALUTION  1.0.0
PARALUTION
mic_matrix_coo.hpp
Go to the documentation of this file.
1 #ifndef PARALUTION_MIC_MATRIX_COO_HPP_
2 #define PARALUTION_MIC_MATRIX_COO_HPP_
3 
4 #include "../base_matrix.hpp"
5 #include "../base_vector.hpp"
6 #include "../matrix_formats.hpp"
7 
8 namespace paralution {
9 
10 template <typename ValueType>
11 class MICAcceleratorMatrixCOO : public MICAcceleratorMatrix<ValueType> {
12 
13 public:
14 
16  MICAcceleratorMatrixCOO(const Paralution_Backend_Descriptor local_backend);
17  virtual ~MICAcceleratorMatrixCOO();
18 
19  virtual void info(void) const;
20  virtual unsigned int get_mat_format(void) const{ return COO; }
21 
22  virtual void Clear(void);
23  virtual void AllocateCOO(const int nnz, const int nrow, const int ncol);
24 
25  virtual bool ConvertFrom(const BaseMatrix<ValueType> &mat);
26 
27  virtual bool Permute(const BaseVector<int> &permutation);
28  virtual bool PermuteBackward(const BaseVector<int> &permutation);
29 
30  virtual void CopyFrom(const BaseMatrix<ValueType> &mat);
31  virtual void CopyTo(BaseMatrix<ValueType> *mat) const;
32 
33  virtual void CopyFromHost(const HostMatrix<ValueType> &src);
34  virtual void CopyToHost(HostMatrix<ValueType> *dst) const;
35 
36  virtual void Apply(const BaseVector<ValueType> &in, BaseVector<ValueType> *out) const;
37  virtual void ApplyAdd(const BaseVector<ValueType> &in, const ValueType scalar,
38  BaseVector<ValueType> *out) const;
39 
40 private:
41 
43 
44  friend class BaseVector<ValueType>;
45  friend class AcceleratorVector<ValueType>;
46  friend class MICAcceleratorVector<ValueType>;
47 
48 };
49 
50 };
51 
52 #endif // PARALUTION_MIC_MATRIX_COO_HPP_
virtual void Apply(const BaseVector< ValueType > &in, BaseVector< ValueType > *out) const
Apply the matrix to vector, out = this*in;.
Definition: mic_matrix_coo.cpp:318
virtual bool Permute(const BaseVector< int > &permutation)
Perform (forward) permutation of the matrix.
Definition: mic_matrix_coo.cpp:382
MICAcceleratorMatrixCOO()
Definition: mic_matrix_coo.cpp:26
virtual void CopyFromHost(const HostMatrix< ValueType > &src)
Copy (accelerator matrix) from host matrix.
Definition: mic_matrix_coo.cpp:121
virtual void CopyFrom(const BaseMatrix< ValueType > &mat)
Copy from another matrix.
Definition: mic_matrix_coo.cpp:204
virtual ~MICAcceleratorMatrixCOO()
Definition: mic_matrix_coo.cpp:49
Definition: backend_manager.hpp:10
nnz
Definition: pcg_example.m:8
const IndexType const IndexType const IndexType const ValueType const ValueType scalar
Definition: cuda_kernels_coo.hpp:91
virtual void ApplyAdd(const BaseVector< ValueType > &in, const ValueType scalar, BaseVector< ValueType > *out) const
Apply and add the matrix to vector, out = out + scalar*this*in;.
Definition: mic_matrix_coo.cpp:349
virtual bool ConvertFrom(const BaseMatrix< ValueType > &mat)
Convert the matrix from another matrix (with different structure)
Definition: mic_matrix_coo.cpp:308
virtual unsigned int get_mat_format(void) const
Return the matrix format id (see matrix_formats.hpp)
Definition: mic_matrix_coo.hpp:20
virtual void CopyToHost(HostMatrix< ValueType > *dst) const
Copy (accelerator matrix) to host matrix.
Definition: mic_matrix_coo.cpp:162
virtual bool PermuteBackward(const BaseVector< int > &permutation)
Perform (backward) permutation of the matrix.
Definition: mic_matrix_coo.cpp:390
MatrixCOO< ValueType, int > mat_
Definition: mic_matrix_coo.hpp:42
Base class for all host/accelerator matrices.
Definition: base_matrix.hpp:92
Definition: base_vector.hpp:22
virtual void CopyTo(BaseMatrix< ValueType > *mat) const
Copy to another matrix.
Definition: mic_matrix_coo.cpp:254
Definition: backend_manager.cpp:43
virtual void info(void) const
Shows simple info about the object.
Definition: mic_matrix_coo.cpp:59
Definition: backend_manager.hpp:14
Definition: matrix_formats.hpp:24
virtual void Clear(void)
Clear (free) the matrix.
Definition: mic_matrix_coo.cpp:100
virtual void AllocateCOO(const int nnz, const int nrow, const int ncol)
Allocate COO Matrix.
Definition: mic_matrix_coo.cpp:66