viennacl / viennacl-dev

Developer repository for ViennaCL. Visit http://viennacl.sourceforge.net/ for the latest releases.
Other
282 stars 91 forks source link

There is no implementation of the addition operation for compressed matrices #259

Open aaamourao opened 6 years ago

aaamourao commented 6 years ago

Hi, I want to sum two compressed matrices, but it seems that there is no operator+ or operator+= implemented for them:

viennacl::compressed_matrix<float> a(3, 3);
viennacl::compressed_matrix<float> b(3, 3);

// Considering it is not using GPU for this toy example, so I can allocate
// dynamic memory on the device
x(1,1) = 1.0f;
y(1,2) = 2.0f;

// The same occurs for x += y;
x = x + y;

I got the following error:

error: no match for ‘operator+’ (operand types are ‘viennacl::compressed_matrix’ and ‘viennacl::compressed_matrix’) 91 x = x + y; 92 \~\~\^\~\~

I'm using ViennaCL with OpenCL.

karlrupp commented 6 years ago

Yes, there is indeed no summation implemented yet. It will be added in the not too distant future.

aaamourao commented 6 years ago

Thanks for the quick answer, @karlrupp

aaamourao commented 6 years ago

@karlrupp The methods begin1(), begin2(), end1() and end2() are not available for compressed matrices. Will it be added in the future too? Should I open an issue for that?

karlrupp commented 6 years ago

@madc0ww The issue with .begin1(), .begin2(), end1() and end2() on compressed matrices in the context of ViennaCL is that they are very inefficient and are likely to cause a lot of trouble for users.