1 #ifndef PARALUTION_GPU_MATRIX_COO_HPP_
2 #define PARALUTION_GPU_MATRIX_COO_HPP_
4 #include "../base_matrix.hpp"
5 #include "../base_vector.hpp"
6 #include "../matrix_formats.hpp"
10 template <
typename ValueType>
11 class GPUAcceleratorMatrixCOO :
public GPUAcceleratorMatrix<ValueType> {
19 virtual void info(
void)
const;
22 virtual void Clear(
void);
23 virtual void AllocateCOO(
const int nnz,
const int nrow,
const int ncol);
25 virtual void SetDataPtrCOO(
int **row,
int **col, ValueType **val,
26 const int nnz,
const int nrow,
const int ncol);
44 virtual void CopyFromCOO(
const int *row,
const int *col,
const ValueType *val);
45 virtual void CopyToCOO(
int *row,
int *col, ValueType *val)
const;
64 #endif // PARALUTION_GPU_MATRIX_COO_HPP_
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;.
virtual bool PermuteBackward(const BaseVector< int > &permutation)
Perform (backward) permutation of the matrix.
GPUAcceleratorMatrixCOO()
Definition: backend_manager.hpp:10
virtual void info(void) const
Shows simple info about the object.
Definition: base_vector.hpp:16
nnz
Definition: pcg_example.m:8
virtual void CopyToAsync(BaseMatrix< ValueType > *mat) const
Copy to another matrix.
const IndexType const IndexType const IndexType const ValueType const ValueType scalar
Definition: cuda_kernels_coo.hpp:91
virtual void CopyFrom(const BaseMatrix< ValueType > &mat)
Copy from another matrix.
virtual void CopyToHost(HostMatrix< ValueType > *dst) const
Copy (accelerator matrix) to host matrix.
virtual void SetDataPtrCOO(int **row, int **col, ValueType **val, const int nnz, const int nrow, const int ncol)
Initialize a COO matrix on the Host with externally allocated data.
virtual void CopyToHostAsync(HostMatrix< ValueType > *dst) const
Async opy (accelerator matrix) to host matrix.
virtual ~GPUAcceleratorMatrixCOO()
virtual void CopyFromHostAsync(const HostMatrix< ValueType > &src)
Async copy (accelerator matrix) from host matrix.
Base class for all host/accelerator matrices.
Definition: base_matrix.hpp:92
virtual void Apply(const BaseVector< ValueType > &in, BaseVector< ValueType > *out) const
Apply the matrix to vector, out = this*in;.
virtual void Clear(void)
Clear (free) the matrix.
virtual bool Permute(const BaseVector< int > &permutation)
Perform (forward) permutation of the matrix.
Definition: backend_manager.cpp:43
virtual void CopyFromAsync(const BaseMatrix< ValueType > &mat)
Async copy from another matrix.
virtual void CopyFromHost(const HostMatrix< ValueType > &src)
Copy (accelerator matrix) from host matrix.
virtual void CopyToCOO(int *row, int *col, ValueType *val) const
Copy to COO array (the arrays have to be allocated)
Definition: backend_manager.hpp:14
virtual bool ConvertFrom(const BaseMatrix< ValueType > &mat)
Convert the matrix from another matrix (with different structure)
virtual void CopyFromCOO(const int *row, const int *col, const ValueType *val)
Copy from COO array (the matrix has to be allocated)
virtual void LeaveDataPtrCOO(int **row, int **col, ValueType **val)
Leave a COO matrix to Host pointers.
MatrixCOO< ValueType, int > mat_
Definition: gpu_matrix_coo.hpp:53
virtual void CopyTo(BaseMatrix< ValueType > *mat) const
Copy to another matrix.
Definition: matrix_formats.hpp:24
virtual unsigned int get_mat_format(void) const
Return the matrix format id (see matrix_formats.hpp)
Definition: gpu_matrix_coo.hpp:20
virtual void AllocateCOO(const int nnz, const int nrow, const int ncol)
Allocate COO Matrix.