Closed jarlebring closed 3 years ago
Maybe &ONE
should be a &onevec
which is preallocated as a vector of ones?
If so, probably the incx (fourth argument) should be 1 and the size (first argument) should be n
.
Wait! It was much more clever than I thought. incx=0
is very clever. The bug is probably just that n*n
should be n
(and keeping everything as before).
cblas_daxpby(n*n, coeff1, &ONE, 0,
ONE, memslots+(1-1)*n*n, n+1);
should be
cblas_daxpby(n, coeff1, &ONE, 0,
ONE, memslots+(1-1)*n*n, n+1);
Do you agree @mfasi ?
Do you agree @mfasi ?
Yes, there was definitely a problem there. I changed n*n
to n
in a bunch of places, hopefully that solved the segmentation fault. The matrices I was using in my tests were probably too small to hit that issue.
Yes. Problem solved. :+1:
When using
lincomb
with an identity matrix it seemsLangC
causes problems.Considering that
ONE
is declared asI believe, this use of
ONE
should be something different:https://github.com/jarlebring/GraphMatFun.jl/blob/2558b55495b7bafeaa0b6082105546407b83352f/src/gen_code.jl#L584-L589
which generates code like
It segfaults.
The third parameter in
axbpy
should be a matrix/vector.I wouldn't mind looking it myself with a hint of what was the plan