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

Span of degenerated (zero-length) subviews is not zero in some special cases #2979

Closed
crtrott opened this issue Apr 25, 2020 · 0 comments
Closed
Assignees
Labels
Bug Broken / incorrect code; it could be Kokkos' responsibility, or others’ (e.g., Trilinos)

Comments

@crtrott
Copy link
Member

crtrott commented Apr 25, 2020

This is an issue which likely was here from the beginning. LayoutLeft and LayoutRight have an internal stride for the left most and right most dimension respectively. In the usual scenario the span is calculated for LayoutLeft for example as m_stridem_dim.N1…*m_dim.N7. But if N0 is zero it should be zero. Note that if you construct a zero length view directly with N0 being zero m_stride is explicitly set to zero. But subview will inherit the stride from the original view.

This could in particular lead to issues when trying to deep_copy such a subview. It also lead to trouble in the new prefetch mechanism for UVM allocations (in this particular case because the zero length subview was created with pair(a.extent(0),a.extent(0)) so that the .data() on the subview was actually the end pointer of the original span, which made the pointer an invalid pointer (not-derefenceable) to give to cudaGetPtrAttributes ,..

Trilinos issue: trilinos/Trilinos#7233

@crtrott crtrott added the Bug Broken / incorrect code; it could be Kokkos' responsibility, or others’ (e.g., Trilinos) label Apr 25, 2020
@crtrott crtrott added this to the Tentative 3.2 Release milestone Apr 25, 2020
@crtrott crtrott self-assigned this Apr 25, 2020
crtrott added a commit to crtrott/kokkos that referenced this issue Apr 27, 2020
crtrott added a commit to crtrott/kokkos that referenced this issue Apr 27, 2020
crtrott added a commit to crtrott/kokkos that referenced this issue Apr 27, 2020
Fixing an issue where subviews can have non-zero span with zero size.
See: issue kokkos#2979
crtrott added a commit to crtrott/kokkos that referenced this issue Apr 27, 2020
crtrott added a commit to crtrott/kokkos that referenced this issue Apr 28, 2020
crtrott added a commit to crtrott/kokkos that referenced this issue Apr 28, 2020
Fixing an issue where subviews can have non-zero span with zero size.
See: issue kokkos#2979
crtrott added a commit to crtrott/kokkos that referenced this issue Apr 28, 2020
@crtrott crtrott closed this as completed May 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Broken / incorrect code; it could be Kokkos' responsibility, or others’ (e.g., Trilinos)
Projects
None yet
Development

No branches or pull requests

1 participant