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

Fix sizeof for non-Array subarrays #36715

Merged
merged 2 commits into from
Jul 20, 2020
Merged

Fix sizeof for non-Array subarrays #36715

merged 2 commits into from
Jul 20, 2020

Conversation

mbauman
Copy link
Sponsor Member

@mbauman mbauman commented Jul 17, 2020

Not all AbstractArrays define elsize. Cf. #35900, #36714.

Not all `AbstractArray`s define elsize.  Cf. #35900, #36714.
@JeffBezanson
Copy link
Sponsor Member

Uhoh, now that I think about it this opens a bigger can of worms. When the dimension 1 stride is not 1, we write elements individually (no alignment padding), and otherwise in memory chunks (yes alignment padding). For SubArrays of Arrays, we should probably change that to always include the padding. I can open a separate PR for that.

Similarly, there might be many other types besides Array that need to use elsize here, so we should probably add a fallback for all AbstractArray types.

@JeffBezanson JeffBezanson merged commit d806fb9 into master Jul 20, 2020
@JeffBezanson JeffBezanson deleted the mb/sizeofsubarray branch July 20, 2020 20:12
JeffBezanson pushed a commit that referenced this pull request Jul 21, 2020
simeonschaub pushed a commit to simeonschaub/julia that referenced this pull request Aug 11, 2020
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.

3 participants