Skip to content

Interpolation

isaki001 edited this page Jan 5, 2022 · 1 revision

Interpolation

A user's integrand can include interpolation operations in a manner similar to the routines provided by the GSL library. To handle the complexity of utilizing the data required for the interpolation (coordinates, tabular data) in memory spaces accessible to the GPU, the user must utilize two Interpolator objects (Interp1D, Interp2D). These objects contain the tabular data and coordinates and move the data accordingly. As the user's data naturally resides in host memory in the form of either arrays, lists, vectors, the user can supply the required data to the constructors of Interp1D, Interp2D, and perform the interpolation by simply providing the value/values to interpolate within the integrand definition.

In the context of parallel execution on the GPU, each integrand evaluation is executed independently by numerous threads, with each thread evaluating the integrand at a different point. As such, the operations within Interp1D are serial, since they are executed by each thread independently. The Interp1D and Interp2D classes, do not leverage multiple threads to execute any part of the interpolation operations in parallel.

Interp1D

To interpolate a given value in one dimension, we must identify the two closest values that exist in the tabular data. This is accomplished by finding the smallest index range (two indices: left, right) within which the value we are trying to interpolate is encompassed. We then use the values of at those two indices to perform the interpolation. We perform this search faster, we follow a method similar to that of binary search. We first check if the index range in the middle of the given data is the index range we are looking for.

Clone this wiki locally