Skip to content

Conversation

@bartgol
Copy link
Contributor

@bartgol bartgol commented Oct 8, 2025

Motivation

Currently, in order to use where_expression, we MUST include the pack headers. However, a type-agnostic function that wants to use where expression should not have to include pack types decl. The customer of the function may not use packs, and just want to call the fcn with regular builtin types. Hence, we need the "scalar" version of where_expression to be available outside of the Pack target. Since it does make use of KOKKOS_INLINE_FUNCTION, it does depend on kokkos, so it makes sense to have it in the KokkosUtils target.

Testing

Split the unit tests in two (scalar inside kokkos folder, packed inside pack folder), and verified they both compile/run correctly.

Allows to define a specialization of it even if ekat::Pack
is not available
@bartgol bartgol requested a review from tcclevenger October 8, 2025 22:08
@bartgol bartgol self-assigned this Oct 8, 2025
@bartgol bartgol added pkg: pack Related to the pack package code usability labels Oct 8, 2025
tcclevenger
tcclevenger previously approved these changes Oct 9, 2025
Copy link
Contributor

@tcclevenger tcclevenger left a comment

Choose a reason for hiding this comment

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

Looks good, just a typo.

@bartgol
Copy link
Contributor Author

bartgol commented Oct 9, 2025

Merging, as the last force push was just to fix the comment typo.

@bartgol bartgol merged commit d198204 into master Oct 9, 2025
4 checks passed
@bartgol bartgol deleted the bartgol/where-expression-mods branch October 9, 2025 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code usability pkg: pack Related to the pack package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants