-
Notifications
You must be signed in to change notification settings - Fork 407
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
shmem_size for LayoutStride #1291
Comments
I see. Yeah this makes sense. I will have a look at this. |
Or rather I will find someone to take a look at this ;-) |
The main issue here is that Kokkos::View<double***, Kokkos::LayoutStride>::shmem_size(extent0, stride0, extent1, stride1, extent2, stride2);
int rank;
int order[3];
int extents[3];
Kokkos::View<double***, Kokkos::LayoutStride>::shmem_size(rank, order, extents); Does that sound like the right approach? |
We think that this looks like a good approach. Thanks! As you pointed out, shmem_size is a static method so we just need a way to get the relevant information to it. Our primary motivation in using shmem_size instead of calculating the memory requirement ourselves is to have Kokkos calculate any required padding for us. |
On second thought, to be consistent with constructors, maybe a better approach is this: Kokkos::View<double***, Kokkos::LayoutStride>::shmem_size(Kokkos::LayoutStride(extent0, stride0, extent1, stride1, extent2, stride2));
int rank;
int order[3];
int extents[3];
Kokkos::View<double***, Kokkos::LayoutStride>::shmem_size(Kokkos::LayoutStride::order_dimensions(rank, order, extents)); Although its more verbose, I think its more consistent with the idea that the arguments to |
We have a multidimensional view that should be LayoutRight (int order [] = {2, 1, 0}) on CPU and LayoutStride (int order [] = {2, 0, 1}) on GPU. (We are using the first dimension to switch between the type of element information in order to reduce the number of views we create. Examples of element information include vertices and height vectors.) We decided to implement both as LayoutStride. We also want this view in shared memory, but we cannot call shmem_size for a view with LayoutStride. We can provide a short example, but we were told that shmem_size is not implemented for LayoutStride so an example does not seem necessary.
Our current toy problem stores doubles in the view. In the interest of a workaround, what downsides can we expect by calculating the shared memory requirement as (number of doubles) * (size of doubles)? Failing that, we can temporarily use LayoutLeft or LayoutRight on GPU, but this sounds expensive in terms of performance. In the future, we are interested in replacing doubles with floats or structs that represent complex numbers or 3D points.
The text was updated successfully, but these errors were encountered: