ormqr/ormlq/ormrq/ormql, unmqr/unmlq/unmrq/unmql: fix minimum workspa…#1292
Open
jschueller wants to merge 1 commit into
Open
ormqr/ormlq/ormrq/ormql, unmqr/unmlq/unmrq/unmql: fix minimum workspa…#1292jschueller wants to merge 1 commit into
jschueller wants to merge 1 commit into
Conversation
…ce for tiny M,N,K
The workspace query formula LWKOPT = NW*NB + TSIZE used TSIZE = LDT*NBMAX
= 65*64 = 4160, a hardcoded constant. The blocked algorithm only stores
one T matrix block at a time (reused across loop iterations), so the
per-iteration workspace is LDT*NB, not LDT*NBMAX. For tiny M,N,K where
a single block suffices (NB >= N or NB >= K), LWKOPT was always >= 4160
regardless of problem size.
Fix: change LWKOPT = NW*NB + TSIZE -> LWKOPT = NW*NB + LDT*NB.
The NB adjustment formula when LWORK is limited must consistently use
the per-iteration T storage instead of TSIZE:
NB = (LWORK - TSIZE) / LDWORK -> NB = LWORK / (LDWORK + LDT)
Applied to all 16 routines (s,d,c,z x {orm,unm}{qr,rq,lq,ql}).
Closes Reference-LAPACK#546
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…ce for tiny M,N,K
The workspace query formula LWKOPT = NWNB + TSIZE used TSIZE = LDTNBMAX = 6564 = 4160, a hardcoded constant. The blocked algorithm only stores one T matrix block at a time (reused across loop iterations), so the per-iteration workspace is LDTNB, not LDT*NBMAX. For tiny M,N,K where a single block suffices (NB >= N or NB >= K), LWKOPT was always >= 4160 regardless of problem size.
Fix: change LWKOPT = NWNB + TSIZE -> LWKOPT = NWNB + LDT*NB.
The NB adjustment formula when LWORK is limited must consistently use the per-iteration T storage instead of TSIZE:
NB = (LWORK - TSIZE) / LDWORK -> NB = LWORK / (LDWORK + LDT)
Applied to all 16 routines (s,d,c,z x {orm,unm}{qr,rq,lq,ql}).
Closes #546