Skip to content
This repository was archived by the owner on Nov 24, 2018. It is now read-only.
This repository was archived by the owner on Nov 24, 2018. It is now read-only.

native: bad computation of work matrix size in Dormqr #176

@vladimir-ch

Description

@vladimir-ch

Dormqr computes the maximum number of columns of a work matrix nwxnb that fits into available workspace. If lwork is not long enough to hold the optimum block size nb, nb is reduced. The code however doesn't update ldwork, leaving it at the previous, unnecessarily large value. If the workspace is long enough to use the blocked code but not long enough to hold the nwxnb matrix, Dlarfb will panic later.

    ldwork := nb // nb is the optimal block size as returned from Ilaenv.
    if nb > 1 && nb < k {
        iws := nw * nb
        if lwork < iws {
            nb = lwork / nw
            // ldwork = nb // <--- Uncommenting fixes the issue.
            nbmin = max(2, impl.Ilaenv(2, "DORMQR", opts, m, n, k, -1))
        }
    }

Speaking of Dormqr, why is t allocated in Dormqr and not taken from work as in the reference LAPACK, @btracey ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions