Skip to content
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

Add 1D interpolation and Bilinear interpolation #3

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

sriharshakandala
Copy link
Member

Purpose

Add 1D interpolation.


  • I have read and checked the items on the review checklist.

@sriharshakandala sriharshakandala linked an issue Dec 16, 2024 that may be closed by this pull request
@sriharshakandala sriharshakandala changed the title Add 1D interpolation. Add 1D interpolation and Bilinear interpolation Jan 6, 2025
@charleskawczynski
Copy link
Member

Can we please break up this PR into one that adds the boiler plate, and another that adds implementations?

println(
"interpolation time = $(Statistics.median(trial_ml_cpu_ft64_interp)) on CPU for $nlevels levels with Float64\nConstructor time = $(Statistics.median(trial_ml_cpu_ft64_cons))",
)
@show "--------------Metal benchmarks---------------"
Copy link
Member

@akshaysridhar akshaysridhar Jan 7, 2025

Choose a reason for hiding this comment

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

This should throw exceptions on incompatible devices right ? Could we reorganise the tests by available device extensions? (or perhaps renaming the tests is sufficient here)

  could not load symbol "MTLCopyAllDevices":
  julia: undefined symbol: MTLCopyAllDevices

Copy link
Member Author

Choose a reason for hiding this comment

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

I am still working on cleaning up the tests. I will fix this shortly.

Comment on lines +75 to +78
function interpolatebilinear!(
ftarget::AbstractArray{FT,N},
bilinear::B,
fsource::AbstractArray{FT,N},
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we allow the arrays for ftarget and fsource to have different lengths, rather than both being N? E.g. if interpolating from low resolution to high resolution

Copy link
Member Author

@sriharshakandala sriharshakandala Jan 18, 2025

Choose a reason for hiding this comment

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

It does. Here, N is just the dimension of the array! It just expects the arrays for the source and target to have the same number of dimensions.
It expects the source functions and target functions to be of sizes (n1, n2, ..., nh1_source, nh2_source) and (n1, n2, ...., nh2_target, nh2_target) respectively. It expects the horizontal dimensions at the end.

Copy link
Member Author

@sriharshakandala sriharshakandala Jan 18, 2025

Choose a reason for hiding this comment

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

Please take a look at the tests here: test/bilinearinterpolation.jl for an example.

@sriharshakandala
Copy link
Member Author

@juliasloan25 : I started a draft PR splitting off the 1D interpolation code here: #6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fast 1D interpolation
4 participants