-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
note on getf2 (unblocked LU factorization) #4174
Comments
|
Obviously you're right about setting jp=m not being much saner, I guess it is just a bit safer to go one element beyond than to grab unrelated memory further away. My impulse reaction would be to "correct" that to j=m-1 and push the skeleton back into the closet for now. (In the 0.2.1x timeframe, most x86_64 assembly kernels were not saving and restoring registers correctly, among other things... well worth revisiting, but I'd rather get 0.3.24 released first) |
Thanks, Martin, for digging out the old issue. As far as I am aware, the current behaviour of IAMAX in reference-LAPACK is flawed in the presence of NaN (if the vector contains NaNs, the index of the first NaN should be returned, which is not the case right now). This will likely be fixed as part of the ongoing Inf and NaN propagation effort. Perhaps an assert/hard-coded check ( |
assert is a bit drastic for a low-level library, and I won't promise that OpenBLAS will comply with the reference implementation's present or future handling of NaNs. I'm pretty sure every implementation handles this differently, so IAMAX with NaNs is essentially invoking undefined behaviour. |
revisiting this, I come to the conclusion that (1) |
https://github.com/xianyi/OpenBLAS/blob/09131f79a6801b9e7ff9dfacdbcbb5acd0a7c86d/lapack/getf2/getf2_k.c#L97-L101
I find the
if (jp>m)
statement confusing and think that line 98 should be removed.IAMAX_K
returns a value between 0 and m-j-1 (inclusive). Hence,jp = j + IAMAX_K(m - j, b + j, 1);
evaluates tojp = m-1
as the largest index. In other words, the condition of the if is not reachable.if (jp>m)
was ever executed, then settingjp = m
would result in accessing an illegal address in line 101,temp1 = b[m]
. b is the column pointer with m rows, ieb[m-1]
is the largest valid index.The text was updated successfully, but these errors were encountered: