Skip to content

Conversation

@bluss
Copy link
Member

@bluss bluss commented Jan 26, 2021

This fixes a bug in layout_impl - if an array is effectively
one-dimensional, like for example has dimension 2 x 1 x 1 (3d array
with len two), then it's possible it is both C and F-contig.

This was the reason for the debug assertion firing: collection starts
into an f-order output array, but when we've split the array enough
times, it's still an f-order array but in shape 1 x 1 x 1 or 2 x 1 x 1
in this case - and we detected that as a c-order array.

  1. fix layout calculation for this case
  2. fix debug assertion condition for layout tendency

Fix #899

This fixes a "bug" in layout_impl - if an array is effectively
one-dimensional, like for example has dimension 2 x 1 x 1 (3d array
with len two), then it's possible it is both C and F-contig.

This was the reason for the debug assertion firing: collection starts
into an f-order output array, but when we've split the array enough
times, it's still an f-order array but in shape 1 x 1 x 1 or 2 x 1 x 1
in this case - and we detected that as a c-order array.
@bluss bluss changed the title Fix broken debug assertion in collect to f-order array Fix bug in layout and broken debug assertion in collect to f-order array Jan 26, 2021
@bluss bluss merged commit 159ae36 into master Jan 30, 2021
@bluss bluss deleted the fix-zip-collect-bug-with-f branch January 30, 2021 12:06
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.

Crash with par_apply_collect, debug, fortran order

2 participants