-
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
Error in subview #2448
Comments
Kokkos::View<double [120][140][96]> f1("label");
auto f2 = Kokkos::subview(f1, Kokkos::ALL, Kokkos::ALL, Kokkos::ALL); edit actually it won't compile either with 2.9.00. I was able to reproduce the issue you describe. Need further investigation :/ update broken by d2b10ae |
Yes, preserving static extents in subview was a feature request that I addressed with that commit you mentioned. I'm surprised, though, that static extents aren't compatible with dynamic extents by default. Also, what breaks in the |
Interesting that this breaks while there seems to be a test very very similar: Kokkos::View<int*[10][5][2], Layout, Space> a;
KOKKOS_INLINE_FUNCTION
int operator()() const noexcept
{
/* Doesn't actually do anything; just static assertions */
auto sub_a = Kokkos::subview(a, 0, Kokkos::ALL, Kokkos::ALL, Kokkos::ALL); |
Yeah as I thought: #include <Kokkos_Core.hpp>
int main (int argc, char* argv[]) {
Kokkos::initialize (argc, argv);
Kokkos::View<double *[120][140][96]> f1;
Kokkos::View<double ***, Kokkos::LayoutStride> f2;
f2=Kokkos::subview(f1, 0,Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL());
Kokkos::finalize ();
} |
The problem appears to be the take a subview of a view with only static extents, and use ALL() on each dimension. It already appears at minimum rank. In the following example only the last one doesn't compile (creation of f8): #include <Kokkos_Core.hpp>
int main (int argc, char* argv[]) {
Kokkos::initialize (argc, argv);
int n = argc>1?atoi(argv[1]):5;
Kokkos::View<double *[96]> f1;
Kokkos::View<double *, Kokkos::LayoutStride> f2;
f2=Kokkos::subview(f1,0, Kokkos::ALL());
Kokkos::View<double *[96]> f3;
Kokkos::View<double **, Kokkos::LayoutStride> f4;
f4=Kokkos::subview(f3,Kokkos::ALL(), Kokkos::ALL());
Kokkos::View<double [96]> f5;
Kokkos::View<double *, Kokkos::LayoutStride> f6;
f6=Kokkos::subview(f5,Kokkos::pair<int,int>(5,5+n));
Kokkos::View<double [96]> f7;
Kokkos::View<double *, Kokkos::LayoutStride> f8;
f8=Kokkos::subview(f7,Kokkos::ALL());
Kokkos::finalize ();
} |
@ramanan this will be fixed in release 3.0. |
(We just merged the fix into the |
I have a code that uses subview and it fails to build when using a Cuda build of Kokkos/2.9.00. This was working fine with 2.8.00. See simple reproducer below.
The build error is: /opt/sw/Kokkos/BuildCuda10.1_2.9.00/include/impl/Kokkos_ViewMapping.hpp(1065): error: static assertion failed with "ViewOffset subview construction requires compatible rank"
Can you tell me if something is wrong or has changed recently?
The text was updated successfully, but these errors were encountered: