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

View constructor should check arguments #1286

Closed
ibaned opened this issue Dec 18, 2017 · 6 comments
Closed

View constructor should check arguments #1286

ibaned opened this issue Dec 18, 2017 · 6 comments
Assignees
Labels
Enhancement Improve existing capability; will potentially require voting
Milestone

Comments

@ibaned
Copy link
Contributor

ibaned commented Dec 18, 2017

The following code compiles and runs with no errors or warnings at all.

Kokkos::View<int> my_view("foo", 100);
std::cout << my_view.extent(0) << '\n'; // prints 1

Our constructors should check for extra arguments that go beyond the rank of the view.

@csiefer2

@ibaned ibaned added the Enhancement Improve existing capability; will potentially require voting label Dec 18, 2017
@ibaned ibaned added this to the 2018 February milestone Dec 18, 2017
@ibaned ibaned self-assigned this Dec 18, 2017
@stanmoore1
Copy link
Contributor

Yeah, I got bit by this before when I forgot a * in the type.

@ibaned
Copy link
Contributor Author

ibaned commented Dec 18, 2017

Unfortunately, this is made difficult by the whole "dimensions greater than rank have extent 1 business", see #1263 and #1036.

@crtrott crtrott assigned swbova and unassigned ibaned Jan 10, 2018
@ibaned
Copy link
Contributor Author

ibaned commented Feb 7, 2018

Remaining piece: constructor should check argument count

@stanmoore1
Copy link
Contributor

Just one more data point: I switched some one-dimensional views to two dimensions, but forgot to add an additional argument to constructor. The code compiled without errors and I had to debug at runtime--not a good user experience.

@ibaned
Copy link
Contributor Author

ibaned commented Feb 13, 2018

@stanmoore1 this will definitely be fixed in the February Kokkos release.

@stanmoore1
Copy link
Contributor

@ibaned awesome, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Improve existing capability; will potentially require voting
Projects
None yet
Development

No branches or pull requests

5 participants