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

Preallocate GPU interpolant #75

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

Preallocate GPU interpolant #75

wants to merge 3 commits into from

Commits on Jul 23, 2024

  1. Configuration menu
    Copy the full SHA
    ca165e1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b8bc893 View commit details
    Browse the repository at this point in the history
  3. Preallocate GPU interpolant

    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.
    Sbozzolo committed Jul 23, 2024
    Configuration menu
    Copy the full SHA
    d39799c View commit details
    Browse the repository at this point in the history