AdaptableFunctions.AdaptableFunctions
— ModuleAdaptableFunctions
Provides an API for functions that can be optimized/specialized for specific input types, sizes and the computing devices the input resides on.
AdaptableFunctions.UnadaptedFunction
— Typestruct UnadaptedFunction{F,T} <: Function
An instance FunctionNotAdaptable{F,T}()
signifies that functions of type F
can't be adapted to inputs of type T
.
(f::UnadaptedFunction).f
contains the original function, and
(f::UnadaptedFunction)(args...; kwargs...)` calls the original function.
AdaptableFunctions.adapt_to_input
— Methodadapt_to_input(f::F, example_input::T) where {F,T}
Generates a function that performs the same operation as f
, but this is optimized/specialized for the type and size of example_input
and the computing device example_input
resides on.
Returns the optimized/specialized version of f, or UnadaptedFunction{F,T}(f)
if this is not possible.