Splines¶
Header File¶
#include<oneapi/mkl/experimental/data_fitting.hpp>
Namespace¶
oneapi::mkl::experimental::data_fitiing
Common API for All Spline Types¶
template <
typename FpType,
typename SplineType,
int Dimensions = 1>
class spline {
public:
using value_type = FpType;
using spline_type = SplineType;
spline(
const sycl::queue& q,
std::int64_t ny = 1);
spline(
const sycl::device& dev,
const sycl::context& ctx,
std::int64_t ny = 1);
~spline();
spline(const spline<FpType, SplineType, Dimensions>& other) = delete;
spline(spline<FpType, SplineType, Dimensions>&& other) = delete;
spline<FpType, SplineType, Dimensions>& operator=(
const spline<FpType, SplineType, Dimensions>& other) = delete;
spline<FpType, SplineType, Dimensions>& operator=(
spline<FpType, SplineType, Dimensions>&& other) = delete;
spline& set_partitions(
FpType* input_data,
std::int64_t nx,
partition_hint PartitionHint = partition_hint::non_uniform);
spline& set_function_values(
FpType* input_data,
function_hint FunctionHint = storage_hint::row_major);
spline& set_coefficients(
FpType* data,
coefficient_hint CoeffHint = storage_hint::row_major);
bool is_initialized() const;
std::int64_t get_required_coeffs_size() const;
sycl::event construct(const std::vector<sycl::event>& dependencies = {});
};
An instance of spline<T, ST, N>
create the N
-dimensional spline
that operates with the T
data type. ST
is a type of spline.
T
can only be float
or double
.
Constructor |
Description |
---|---|
|
Create an object with the |
|
Create an object using the |
Member function |
Description |
---|---|
|
Set partition values that are specified by the Example, for |
|
Set function values that are specified by the |
|
Set coefficients that are specified by the |
|
Returns |
|
Returns amount of memory that is required for coefficients storage. |
|
Constructs the spline (calculates spline coefficients).
The function submits a SYCL kernel and returns the SYCL event to wait on to ensure computation is complete.
|
There are some splines that requires internal conditions and boundary conditions to be set. For such spline types, the following member functions must be called.
spline& set_internal_conditions(
FpType* input_data);
spline& set_boundary_conditions(
bc_type BCType = bc_type::free_end,
FpType input_value = {});
Member function |
Description |
---|---|
|
Set internal conditions that are specified by the |
|
Set the |
Note
copy/move constructor and copy/move assignment operators are deleted
since the spline
class is just a wrapper over memory that users provide.
Memory management responsibility is on user’s side.
Supported Spline Types¶
Currently, the DPC++ Data Fitting APIs support the following spline types (follow the corresponding links to deep-dive into the details):