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

Can I allocate a View w/ both WithoutInitializing & AllowPadding? #324

Closed
mhoemmen opened this issue Jun 9, 2016 · 7 comments
Closed

Can I allocate a View w/ both WithoutInitializing & AllowPadding? #324

mhoemmen opened this issue Jun 9, 2016 · 7 comments
Assignees
Labels
Bug Broken / incorrect code; it could be Kokkos' responsibility, or others’ (e.g., Trilinos)
Milestone

Comments

@mhoemmen
Copy link
Contributor

mhoemmen commented Jun 9, 2016

Is it possible to allocate a View with both WithoutInitializing and AllowPadding? I don't see a way to nest those allocation parameters. Do they just nest, as they do with the string label?
#319 would fix this because I wouldn't need to pass in AllowPadding at run time; the compile-time memory trait would suffice.

@mhoemmen mhoemmen added the Question For Kokkos internal and external contributors and users label Jun 9, 2016
@mhoemmen
Copy link
Contributor Author

mhoemmen commented Jun 9, 2016

trilinos/Trilinos#423 depends on this.

@hcedwar
Copy link
Contributor

hcedwar commented Jun 9, 2016

View<...> a( view_alloc( "label" , WithoutInitializing , AllowPadding ) , N0 , N1 , ... );

@mhoemmen
Copy link
Contributor Author

mhoemmen commented Jun 9, 2016

Thanks @hcedwar ! But see #325. Also, when I try this, I get the following static_assert:

...
.../Trilinos/packages/kokkos/core/src/KokkosExp_View.hpp: In instantiation of ‘Kokkos::Experimental::Impl::ViewCtorProp<typename Kokkos::Experimental::Impl::ViewCtorProp<void, P>::type ...> Kokkos::Experimental::view_alloc(const Args& ...) [with Args = {const char_, Kokkos::Experimental::Impl::WithoutInitializing_t, Kokkos::Experimental::Impl::AllowPadding_t}]’:
.../Trilinos/packages/tpetra/core/src/Tpetra_MultiVector_def.hpp:146:79: required from ‘typename Tpetra::MultiVector<ST, LO, GO, NT>::dual_view_type {anonymous}::allocDualView(size_t, size_t, bool) [with ST = double; LO = int; GO = long long int; NT = Kokkos::Compat::KokkosDeviceWrapperNodeKokkos::Serial; typename Tpetra::MultiVector<ST, LO, GO, NT>::dual_view_type = Kokkos::DualView<double_*, Kokkos::LayoutLeft, Kokkos::Serial, void>; size_t = long unsigned int]’
.../Trilinos/packages/tpetra/core/src/Tpetra_MultiVector_def.hpp:273:70: required from ‘Tpetra::MultiVector<S, LO, GO, N, classic>::MultiVector(const Teuchos::RCP<const Tpetra::Map<LocalOrdinal, GlobalOrdinal, Node> >&, size_t, bool) [with Scalar = double; LocalOrdinal = int; GlobalOrdinal = long long int; Node = Kokkos::Compat::KokkosDeviceWrapperNodeKokkos::Serial; bool classic = false; size_t = long unsigned int]’
.../Trilinos/packages/tpetra/core/src/Tpetra_MultiVector_DOUBLE_INT_LONG_LONG_SERIAL.cpp:78:3: required from here
.../Trilinos/packages/kokkos/core/src/KokkosExp_View.hpp:425:3: error: static assertion failed: Cannot give pointer-to-memory for view allocation
static_assert( ! return_type::has_pointer

@mhoemmen
Copy link
Contributor Author

mhoemmen commented Jun 9, 2016

Here is the line of code in question:

typename dual_view_type::t_dev d_view (Kokkos::Experimental::view_alloc (label, Kokkos::Experimental::WithoutInitializing, Kokkos::Experimental::AllowPadding), lclNumRows, numCols);

@mhoemmen mhoemmen removed the Question For Kokkos internal and external contributors and users label Jun 13, 2016
@mhoemmen
Copy link
Contributor Author

I'm not sure whether this is a question or bug, so I removed the "question" label.

@hcedwar hcedwar added the Bug Broken / incorrect code; it could be Kokkos' responsibility, or others’ (e.g., Trilinos) label Jul 20, 2016
@hcedwar hcedwar added this to the Backlog milestone Jul 20, 2016
@mhoemmen
Copy link
Contributor Author

The answer to my question is "yes," so I'm calling this bug closed. Thanks all!

@crtrott crtrott modified the milestones: Fall 2016, Backlog Sep 19, 2016
@crtrott
Copy link
Member

crtrott commented Sep 19, 2016

Assigning to Fall, I don't want closed issues on backlog. Its kind of weird to have completion rate higher than 0% on backlog ....

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

3 participants