-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The interpolants we in `Interpolations.jl` are described by two arrays: the knots and the coeffs. When `Adapt` is called on these interpolants, CuArrays are allocated on the GPU. For large data, this is inefficient. In this commit, I add a system to avoid these allocations. This is accomplished by add a dictionary to `InterpolationsRegridder`. This dictionary has keys that identify the size of the knots and coefficients and values the adapted splines. When `regrid` is called, we check if we have already allocated some suitable space in this dictionary, if not, we create a new spline, if we do, we write in place. This removes GPU allocations in the hot path (ie, the regridder is used in a time evolution with always the same data and dimensions), while also keeping the flexibility of reusing the same regridder with any input data.
- Loading branch information
Showing
1 changed file
with
59 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters