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

Incorrect constraints on View(const View<DT, Prop...> &rhs) #6948

Open
nmm0 opened this issue Apr 17, 2024 · 1 comment
Open

Incorrect constraints on View(const View<DT, Prop...> &rhs) #6948

nmm0 opened this issue Apr 17, 2024 · 1 comment
Assignees

Comments

@nmm0
Copy link
Contributor

nmm0 commented Apr 17, 2024

Describe the bug

Our constraints are too relaxed and allow incompatible view types (i.e. rank > 1 of construction between a LayoutLeft and LayoutRight view). The code won't actually compile as we static assert, but it means that std::constructible_v<dst_type,src_type> gives the incorrect result.

Please include the following for a minimal reproducer

  1. Compilers (with versions) all
  2. Kokkos release or commit used (i.e., the sha1 number) confirmed on current develop and 4.2

Reproducer: https://godbolt.org/z/3roWPjzsz

@nmm0 nmm0 self-assigned this Apr 17, 2024
@nmm0 nmm0 added the Bug Broken / incorrect code; it could be Kokkos' responsibility, or others’ (e.g., Trilinos) label Apr 17, 2024
nmm0 added a commit to nmm0/kokkos that referenced this issue Apr 17, 2024
nmm0 added a commit to nmm0/kokkos that referenced this issue Apr 17, 2024
…emove is_assignable_data_type which is now not used anywhere
@crtrott crtrott removed the Bug Broken / incorrect code; it could be Kokkos' responsibility, or others’ (e.g., Trilinos) label Apr 23, 2024
@crtrott
Copy link
Member

crtrott commented Apr 23, 2024

This was not a bug or mistake: it was a design choice to provide comprehensible error messages. The issue is that the trait is_constructible_v is misleading since it only takes into account constraints and not mandates. With C++20 error messages of constraints become much better thanks to concepts. My current proposal is to shift constructor mandates to constraints when we compile with C++20 mode, but leave them alone in C++17 mode.

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

No branches or pull requests

2 participants