8000 MAINT: add test for 12-byte alignment by ahaldane · Pull Request #12618 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

MAINT: add test for 12-byte alignment #12618

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
merged 1 commit into from
Dec 27, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions numpy/core/tests/test_multiarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -8000,10 +8000,10 @@ def check(self, shape, dtype, order, align):
raise ValueError()

def test_various_alignments(self):
for align in [1, 2, 3, 4, 8, 16, 32, 64, None]:
for align in [1, 2, 3, 4, 8, 12, 16, 32, 64, None]:
for n in [0, 1, 3, 11]:
for order in ["C", "F", None]:
for dtype in np.typecodes["All"]:
for dtype in list(np.typecodes["All"]) + ['i4,i4,i4']:
Copy link
Member

Choose a reason for hiding this comment

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

Why is this needed?

Copy link
Member Author
@ahaldane ahaldane Dec 26, 2018

Choose a reason for hiding this comment

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

I thought it would be good to throw in a 12-byte-equivalence type, and i4,i4,i4 is 12 bytes.

(if a 12-byte-uint existed it would be uint-aligned to 12 bytes. But actually it is not uint-alignable).

if dtype == 'O':
# object dtype can't be misaligned
continue
Expand Down
0