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

Subview assign of 1D Strided with stride 1 to LayoutLeft/Right #1

Closed
crtrott opened this issue Apr 15, 2015 · 4 comments
Closed

Subview assign of 1D Strided with stride 1 to LayoutLeft/Right #1

crtrott opened this issue Apr 15, 2015 · 4 comments
Labels
Enhancement Improve existing capability; will potentially require voting

Comments

@crtrott
Copy link
Member

crtrott commented Apr 15, 2015

I'd like to be able to assign a 1D strided view with stride 1 to LayoutLeft or LayoutRight 1D views.
This will prevent performance degradation when calling a vector version of a multivector kernel when the number of vectors in the multivector is 1.

@crtrott crtrott added the Enhancement Improve existing capability; will potentially require voting label Apr 15, 2015
@crtrott
Copy link
Member Author

crtrott commented Apr 22, 2015

I pushed the necessary code and unit tests for it. It is now legal to do stuff like this:
Kokkos::View<double**,LayoutRight> X("X",N,1);
Kokkos::View<double*,LayoutLeft> x_0 = Kokkos::subview(X,Kokkos::ALL(),0);
This will first create a Kokkos::View<double*,LayoutStride> and than assign it to the LayoutLeft.
Using that LayoutLeft view is than much more performant in kernels than using the LayoutStride one which would result from
auto x_0 = Kokkos::subview(X,Kokkos::ALL(),0);
since its indexing is much simpler.

@crtrott crtrott closed this as completed Apr 22, 2015
@mhoemmen
Copy link
Contributor

Hold on a bit: does

auto x_0 = subview (X, ALL (), 0);

always result in a LayoutStride View? If so, I'll have to revisit Tpetra...

@mhoemmen mhoemmen reopened this Apr 22, 2015
@crtrott
Copy link
Member Author

crtrott commented Apr 22, 2015

No the return type depends on the Layout of X. For LayoutLeft (the tpetra case) this returns LayoutLeft.
For LayoutRight it would return LayoutStride.

@crtrott crtrott closed this as completed Apr 22, 2015
@mhoemmen
Copy link
Contributor

ok cool thanks!

dsunder added a commit that referenced this issue May 18, 2017
hcedwar pushed a commit that referenced this issue Jun 26, 2017
crtrott pushed a commit that referenced this issue Sep 11, 2019
crtrott pushed a commit that referenced this issue Sep 23, 2019
update cmake test all from apollo unit test
bjoo pushed a commit to bjoo/kokkos that referenced this issue Mar 27, 2020
CMake fixes... All this will need to change when Nevin Updates to 3
crtrott pushed a commit that referenced this issue Sep 16, 2020
Unable to link with Trilinos, due to unconditional "-x cuda" compile flags
antoinemeyer5 pushed a commit to antoinemeyer5/kokkos that referenced this issue May 24, 2023
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

2 participants