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

Runtime rank wrapper for View #189

Closed
hcedwar opened this issue Feb 15, 2016 · 9 comments
Closed

Runtime rank wrapper for View #189

hcedwar opened this issue Feb 15, 2016 · 9 comments
Assignees
Labels
Feature Request Create new capability; will potentially require voting
Milestone

Comments

@hcedwar
Copy link
Contributor

hcedwar commented Feb 15, 2016

Provide a thin wrapper over a rank eight View that supports a runtime rank between zero and eight. The member access operator overloads simply fill in the missing arguments to the underlying View operator with the literal value 0. It is assumed that compilers' optimization will eliminate the integer index operations with hard-coded zero values.

@hcedwar hcedwar added the Feature Request Create new capability; will potentially require voting label Feb 15, 2016
@nmhamster
Copy link
Contributor

Should we test out the compiler inling/optimization etc?

@hcedwar
Copy link
Contributor Author

hcedwar commented Feb 15, 2016

Would be good, but not necessary as this Kokkos feature will replace an already non-performing application specific feature.

@crtrott
Copy link
Member

crtrott commented Mar 2, 2016

I just merged the pull request. I think there are a couple more corner cases to be worked on in addition to subviews, but the basic capability seems to be there and the implementation looks fundamentally sound.

@crtrott
Copy link
Member

crtrott commented Mar 2, 2016

First issue I currently see as outstanding: creating degenerated Views. E.g. a 2D view with second dimension==0 would come out as a 1D view right now. We should fix that by having explicit constructors with different number of arguments.
Second outstanding issue: subviews must be correctly implemented.

@hcedwar
Copy link
Contributor Author

hcedwar commented Mar 3, 2016

other option based upon related discussion at ISO/C++ meeting is to change the dimension argument types to ptrdiff_t = -1, then deduce rank by the first non-negative input.

@hcedwar hcedwar added this to the Spring 2016 milestone Mar 8, 2016
@ndellingwood ndellingwood modified the milestones: GTC 2016 , Spring 2016 Mar 16, 2016
@ndellingwood
Copy link
Contributor

The dynamic rank view with subview functionality is now available in the kokkos develop branch.

The DynRankView code is located in kokkos/containers/src/Kokkos_DynRankView.hpp
Sample usage available in the unit tests kokkos/containers/src/TestDynViewAPI.hpp

A couple comments, including changes from Kokkos::View:

  1. Max rank of a DynRankView is 7
  2. The rank of the DynRankView is returned by the function rank()
  3. subdynrankview is the name for the function to create 'subviews' of dynamic rank views.
  4. Every subdynrankview is returned with LayoutStride

hcedwar added a commit that referenced this issue Mar 23, 2016
…189), and Trilinos Stokhos and Sacado libraries is simplified by having all variants of View constructors that accept a Layout.  Add this option for the shared memory View constructor.
@hcedwar
Copy link
Contributor Author

hcedwar commented Mar 28, 2016

Fine tune subdynrankview for Trilinos/Intrepid to allow and ignore excess ALL subview arguments.

@ndellingwood
Copy link
Contributor

Modifications to DynRankView and subdynrankview:

  1. Enhancement for subdynrankview

Relaxed assumption that number of arguments to a subdynrankview must equal
the rank of the source DynRankView - a subdynrankview can now accept
greater number of arguments than the source dynrankview rank, the
additional are ignored.

  1. LayoutStride fix for DynRankView

Added createLayout code for LayoutStride input case for construction of DynRankView

  1. Additional unit tests added to check LayoutStride DynRankView input to
    subdynrankview, that subdynrankview ranks contract as expected, and that
    subdynrankview acts properly when given more arguments than source rank.

@crtrott
Copy link
Member

crtrott commented Apr 1, 2016

Merged into master again. Can this be closed now?

@hcedwar hcedwar closed this as completed Apr 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Create new capability; will potentially require voting
Projects
None yet
Development

No branches or pull requests

4 participants