stencilfun
Description
[
applies the function OUT
_1,...,OUT
_N] = stencilfun(func
,X
,W
)func
to each sliding window of size
W
of the input array X
.
stencilfun
outputs a number of equally-sized output arrays equal to the
number of outputs of func
. Each call made to func
computes a single element of each output array. The index of this element corresponds to the
center of the sliding window in the input array.
___ = stencilfun(___,
performs stencil operation by using the options specified by one or more
Name,Value
)Name,Value
pair arguments.
Examples
Input Arguments
Output Arguments
Tips
It is recommended not to use toolbox functions such as
sum
inside the callback functionfunc
. When iterating through elements of the window, explicit loops should be used instead.When indexing the window parameter of the callback function
func
, each index operation must access only a single element of the window. Linear indexing is not supported.The callback must always be inlined using
coder.inline('always')
.The window parameter must not be modified inside the callback.
Version History
Introduced in R2022b
See Also
Apps
Functions
codegen
|coder.gpu.kernel
|gpucoder.matrixMatrixKernel
|coder.gpu.constantMemory
|gpucoder.reduce
|gpucoder.sort
|coder.gpu.nokernel