Skip to content
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

Allow for multi-dimensional arrays in FROM-ARRAY constructor. #105

Merged
merged 5 commits into from
May 29, 2020

Conversation

colescott
Copy link
Member

@colescott colescott commented Apr 21, 2020

Allows for multi-dimensional arrays as input to FROM-ARRAY (Resolves #102)

This also adds a new kw arg to FROM-ARRAY, INPUT-LAYOUT which allows for reindexing of input arrays (INPUT-LAYOUT does not need to be the same as LAYOUT).

As a bonus, fixes a bug that came up while testing this PR caused by LAPACK-INV not setting the layout of the tensor to COLUMN-MAJOR after fortran touched it.

Any number of dimensions are supported, however the input layout MUST be row-major.
Input array is now copied.
@colescott colescott self-assigned this Apr 21, 2020
Copy link
Member

@notmgsk notmgsk left a comment

Choose a reason for hiding this comment

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

Would you add a suitable test? Make sure it really do be like what they think it be.

src/high-level/constructors.lisp Outdated Show resolved Hide resolved
src/high-level/constructors.lisp Outdated Show resolved Hide resolved
- Add INPUT-LAYOUT and code to copy arrays in the correct order.
- Update all existing references to FROM-ARRAY to reflect changes.
- Squash a particularly nasty bug where INV would output would have the
  wrong layout when input is ROW-MAJOR.
- Add tests for FROM-ARRAY with varying dimensions and layouts
@colescott
Copy link
Member Author

All the outstanding issues (hopefully) have been resolved. As a bonus I squashed a bug caused by inv not setting the output layout :D

tests/constructor-tests.lisp Outdated Show resolved Hide resolved
tests/constructor-tests.lisp Outdated Show resolved Hide resolved
tests/constructor-tests.lisp Outdated Show resolved Hide resolved
src/high-level/constructors.lisp Outdated Show resolved Hide resolved
src/high-level/constructors.lisp Show resolved Hide resolved
@notmgsk
Copy link
Member

notmgsk commented May 9, 2020

$ ping @stylewarning

@colescott colescott requested a review from notmgsk May 14, 2020 21:16
@stylewarning stylewarning merged commit 426e8c4 into master May 29, 2020
@stylewarning stylewarning deleted the fix/from-array-dimensions branch May 29, 2020 18:00
@stylewarning
Copy link
Member

Sorry all, especially @colescott, for the delay in approving. Thanks for the contribution!

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.

FROM-ARRAY is broken for rank 2+ arrays
3 participants