Skip to content

KokkosBatched_Util: allow DynRankView in rank checks#3034

Closed
japlews wants to merge 1 commit intokokkos:developfrom
japlews:japlews/allow-dynrankview-kokkos-batched-util
Closed

KokkosBatched_Util: allow DynRankView in rank checks#3034
japlews wants to merge 1 commit intokokkos:developfrom
japlews:japlews/allow-dynrankview-kokkos-batched-util

Conversation

@japlews
Copy link
Copy Markdown
Contributor

@japlews japlews commented Apr 15, 2026

Conditionally disable some compile-time checking

  Conditionally disable some compile-time checking
@japlews
Copy link
Copy Markdown
Contributor Author

japlews commented Apr 15, 2026

@lucbv

Copy link
Copy Markdown
Contributor

@lucbv lucbv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have a look at how the dynamic view is implemented and see if it returns extents for the dynamic ranks or static ranks only?

static_assert(V_rank <= 2, "KokkosBatched: ViewType must have rank 0, 1 or 2.");
// Only allow View and DynRankView objects
if constexpr (Kokkos::is_view_v<ViewType>) {
static_assert(ViewType::rank() == 2, "KokkosBatched: ViewType must be rank 0, 1, or 2");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
static_assert(ViewType::rank() == 2, "KokkosBatched: ViewType must be rank 0, 1, or 2");
static_assert(ViewType::rank() <= 2, "KokkosBatched: ViewType must be rank 0, 1, or 2");

static_assert(V_rank <= 2, "KokkosBatched: ViewType must have rank 0, 1 or 2.");
// Only allow View and DynRankView objects
if constexpr (Kokkos::is_view_v<ViewType>) {
static_assert(ViewType::rank() == 2, "KokkosBatched: ViewType must be rank 0, 1, or 2");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
static_assert(ViewType::rank() == 2, "KokkosBatched: ViewType must be rank 0, 1, or 2");
static_assert(ViewType::rank() <= 2, "KokkosBatched: ViewType must be rank 0, 1, or 2");

Comment thread batched/KokkosBatched_Util.hpp
Comment thread batched/KokkosBatched_Util.hpp
@ndellingwood ndellingwood added the AT2-CI-APPROVAL Approve CI to run at SNL label Apr 15, 2026
@ndellingwood
Copy link
Copy Markdown
Contributor

@lucbv when this PR is finalized should it be include with 5.1.1?

@lucbv
Copy link
Copy Markdown
Contributor

lucbv commented Apr 20, 2026

Closing this since #3036 merged

@lucbv lucbv closed this Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AT2-CI-APPROVAL Approve CI to run at SNL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants