clMathLibraries / clSPARSE

a software library containing Sparse functions written in OpenCL
Apache License 2.0
173 stars 60 forks source link

Wrong system size checks? #204

Closed TillAlex closed 7 years ago

TillAlex commented 7 years ago

When starting a solver the following parameter check is done

if( ( pA->num_cols != pB->num_values ) || ( pA->num_rows != pX->num_values ) ) { return clsparseInvalidSystemSize; }

(Same in bi-conjugate solver)

From my understanding the number of columns of A should match the number of elements of x while the number of rows matches the number of elements of b.

This corresponds to what is done in the samples. There the sizes are defined like this: x.num_values = A.num_cols; and b.num_values = A.num_rows.

Am I missing something?

kknox commented 7 years ago

Can you link to the library code and the sample code you reference above?

TillAlex commented 7 years ago

You can find the links in the first post now.

TillAlex commented 7 years ago

Attached you find a patch fixing the solvers for non square matrices:

SystemSizePatch.zip

kknox commented 7 years ago

You may not be familiar with github, but do you know how to submit code through a PR? If not, i'll try to get this patch merged manually sometime this week.