34 #ifndef __GPUMATRIX_H__
35 #define __GPUMATRIX_H__
45 #ifndef SWIG // SWIG should skip this part
48 template <
class,
class,
class,
class>
class matrix_base;
49 template <
class>
class const_entry_proxy;
50 template <
class>
class entry_proxy;
61 template <
class,
int,
int,
int,
int,
int>
class Matrix;
67 template <
class>
class SGMatrix;
80 template <
class T>
class CGPUMatrix
83 typedef viennacl::matrix_base<T, viennacl::column_major, std::size_t, std::ptrdiff_t> VCLMatrixBase;
84 typedef viennacl::backend::mem_handle VCLMemoryArray;
93 template <
typename ST>
using container_type = CGPUMatrix<ST>;
113 CGPUMatrix(std::shared_ptr<VCLMemoryArray> mem,
index_t nrows,
index_t ncols,
117 CGPUMatrix(
const SGMatrix<T>& cpu_mat);
120 operator SGMatrix<T>()
const;
124 CGPUMatrix(
const EigenMatrixXt& cpu_mat);
127 operator EigenMatrixXt()
const;
128 #endif // HAVE_EIGEN3
131 inline VCLMatrixBase data()
137 inline uint64_t size()
const
139 const uint64_t c=num_cols;
146 VCLMatrixBase vcl_matrix();
155 void set_const(T value);
158 void display_matrix(
const char* name=
"matrix")
const;
166 viennacl::const_entry_proxy<T> operator()(
index_t i,
index_t j)
const;
181 viennacl::const_entry_proxy<T> operator[](
index_t index)
const;
188 viennacl::entry_proxy<T> operator[](
index_t index);
195 std::shared_ptr<VCLMemoryArray> matrix;
213 #endif // HAVE_VIENNACL
214 #endif // __GPUMATRIX_H__
all of classes and functions are contained in the shogun namespace