Skip to content

Conversation

@bartgol
Copy link
Contributor

@bartgol bartgol commented Aug 23, 2025

Motivation

I wanted to use adj_diff inside EAMxx's column ops structure (specifically, the compute_midpoint_delta_impl function). But that function has to be callable when the input is not a view, but a lambda. This required an upgrade of adj_diff.

The new interface has an additional argument, which states the last valid index for which we can call v(k). That's b/c if v is a lambda, we cannot call v.size(), like we did for views.

The old interface for the case where the input is a view is still available, and simply calls the new one with index_last = v.size()-1.

Testing

Upgraded the adj_diff test to test both view and lambda providers

Separate thought: maybe adj_diff belongs to the ekat::Algorithm package?

@bartgol bartgol requested a review from jgfouca August 23, 2025 00:52
@bartgol bartgol self-assigned this Aug 23, 2025
@bartgol bartgol added enhancement New feature or request pkg: pack Related to the pack package labels Aug 23, 2025
Copy link
Member

@jgfouca jgfouca left a comment

Choose a reason for hiding this comment

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

lgtm

@bartgol bartgol merged commit 5624615 into master Aug 26, 2025
4 checks passed
@bartgol bartgol deleted the bartgol/adj-diff-upgrade branch August 26, 2025 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request pkg: pack Related to the pack package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants