Commit 916d3bc
authored
Fix solve_impl() mixups args and cusolverSpScsrcholBufferInfoHost() call with wrong values (#10)
* fix wrong argument order in solve_impl call
solve_impl(n, x.ptr(), b.ptr()); // WRONG!
The signature is solve_impl(int n, Real* b, Real* x), but x and b are swapped. This means the solver writes the solution to the wrong buffer. Should be:
solve_impl(n, b.ptr(), x.ptr());
* fix Wrong buffer used for CPU float path
checksolver(cusolverSpScsrcholBufferInfoHost( handle, rows, nnz, descr, device_values, hRow, hCol, ...));
This uses device_values instead of hValues (unlike the double version at line 124). This would access invalid memory when running on CPU with float precision.1 parent 4d5a61b commit 916d3bc
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
| 129 | + | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| |||
434 | 434 | | |
435 | 435 | | |
436 | 436 | | |
437 | | - | |
| 437 | + | |
438 | 438 | | |
439 | 439 | | |
440 | 440 | | |
| |||
0 commit comments