Optimize more kinds of copies #306
Labels
enhancement
New feature or request
good first issue
Good for newcomers
work ready
This task is ready to be worked on
Currently, we understand and optimize a few kinds of copies by expressing the copy as a buffer metadata manipulation like setting the stride. This is supported by this helper:
slinky/builder/optimizations.cc
Line 34 in 81bd036
To be more specific, the copies we support now are of the form:
f(x) = g(C)
whereC
is not a function ofx
.f(x) = g(x + C)
We could support additional kinds of copies, like:
f(x) = g(x * C)
, by multiplying the stride by C. Interestingly, we can't support upsamples, because dividing the stride is not right.f(x) = g(x % C)
, we can only do this if we know thatg
doesn't already have a fold factor, so we can set the fold factor toC
.The text was updated successfully, but these errors were encountered: