-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
BUG: longdouble with elsize 12 is never uint alignable #12611
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
Changes from 1 commit
d2ec5a1
16c30d0
cb690e5
617dbcb
de4c4ef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,7 +88,8 @@ broadcast_strides(int ndim, npy_intp *shape, | |
/* | ||
* Checks whether a data pointer + set of strides refers to a raw | ||
* array whose elements are all aligned to a given alignment. | ||
* alignment should be a power of two. | ||
* alignment should be a power of two, or may be the sentinel value 0 to mean | ||
* unaligned, in which case false is always returned. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment confuses me - I read this as saying that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I am not misreading you, that is what the comment is meant to say. If you pass an alignment of 0, the function always returns "not aligned". Do you mean I should say "not aligned" instead of "unaligned"? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right. the return value means "not aligned", but the meaning of the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixing |
||
*/ | ||
NPY_NO_EXPORT int | ||
raw_array_is_aligned(int ndim, npy_intp *shape, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is
alignment == 0
even a legal argument to this function?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe there is a better way to organize it... but the idea is that
npy_uint_alignment
, which normally returns the uint alignment, returns 0 if the type is not uint-alignable.Then, it turned out to be convenient to allow the result of
npy_uint_alignment
to be passed directly toraw_array_is_aligned
.An alternative would be to check the return value of
npy_uint_alignment
explicitly everywhere it is used. But since it is pretty much always used as an arg toraw_array_is_aligned
it seemed less complicated this way.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed the comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks