Skip to content

LAPACKE: don't allocate transposed matrix in ?lantr_work #382

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

Merged

Conversation

vladimir-ch
Copy link
Contributor

This PR modifies LAPACKE_?lantr_work functions to avoid allocation (and filling) of the transposed triangular matrix a_t. It uses the standard trick that a lower triangular matrix in row-major storage can be viewed as an upper triangular matrix in column-major (and vice versa) if the parameters are properly adjusted. In fact, this is the same approach that LAPACKE_?lange_work functions use. With this approach a new work array must be allocated because the rows and columns are "swapped" between row/column-major (and not because LAPACKE is taking into account that it would make sense to have work sized differently in row major as I originally misunderstood).

I feel a little uneasy because of the lack of any tests but at least for double precision our Gonum test passes.

@codecov
Copy link

codecov bot commented Jan 10, 2020

Codecov Report

Merging #382 into master will increase coverage by 2.35%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #382      +/-   ##
==========================================
+ Coverage   80.88%   83.24%   +2.35%     
==========================================
  Files        1863     1808      -55     
  Lines      181151   170181   -10970     
==========================================
- Hits       146528   141664    -4864     
+ Misses      34623    28517    -6106
Impacted Files Coverage Δ
SRC/dlat2s.f 76.47% <0%> (-4.49%) ⬇️
SRC/dtgexc.f 46.35% <0%> (-3.98%) ⬇️
SRC/dlansb.f 62.5% <0%> (-3.29%) ⬇️
SRC/slansb.f 62.5% <0%> (-3.29%) ⬇️
SRC/clansy.f 65.51% <0%> (-3.06%) ⬇️
SRC/slangb.f 72.5% <0%> (-3.02%) ⬇️
SRC/dlangb.f 72.5% <0%> (-3.02%) ⬇️
SRC/clangb.f 72.5% <0%> (-3.02%) ⬇️
SRC/clals0.f 80.16% <0%> (-2.82%) ⬇️
SRC/dlarrk.f 87.8% <0%> (-2.68%) ⬇️
... and 1207 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f24797e...fd8f680. Read the comment docs.

Copy link
Contributor

@langou langou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent! Very elegant. Thanks!

@langou langou added this to the LAPACK 3.10.0 milestone Mar 25, 2021
@julielangou julielangou merged commit 77a0ceb into Reference-LAPACK:master Mar 25, 2021
christoph-conrads pushed a commit to christoph-conrads/lapack that referenced this pull request May 23, 2021
…tr-no-alloc-trans

LAPACKE: don't allocate transposed matrix in ?lantr_work
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants