From eaa892caca2551b42a8dc6d0dba01161be17dde7 Mon Sep 17 00:00:00 2001 From: Steven Johnson Date: Mon, 11 Apr 2022 17:34:23 -0700 Subject: [PATCH] Remove deprecated versions of Func::prefetch() --- python_bindings/src/PyScheduleMethods.h | 20 ------- src/Func.h | 69 ++----------------------- 2 files changed, 4 insertions(+), 85 deletions(-) diff --git a/python_bindings/src/PyScheduleMethods.h b/python_bindings/src/PyScheduleMethods.h index 8280ccd99ec5..2ac84fb5a400 100644 --- a/python_bindings/src/PyScheduleMethods.h +++ b/python_bindings/src/PyScheduleMethods.h @@ -88,26 +88,6 @@ HALIDE_NEVER_INLINE void add_schedule_methods(PythonClass &class_instance) { .def("hexagon", &T::hexagon, py::arg("x") = Var::outermost()) - .def( - "prefetch", [](T &t, const Func &f, const VarOrRVar &var, int offset, PrefetchBoundStrategy strategy) -> T & { - // HALIDE_ATTRIBUTE_DEPRECATED("Call prefetch() with the two-var form instead.") - PyErr_WarnEx(PyExc_DeprecationWarning, - "Call prefetch() with the two-var form instead.", - 1); - return t.prefetch(f, var, var, offset, strategy); - }, - py::arg("image"), py::arg("var"), py::arg("offset") = 1, py::arg("strategy") = PrefetchBoundStrategy::GuardWithIf) - .def( - "prefetch", [](T &t, const ImageParam &image, const VarOrRVar &var, int offset, PrefetchBoundStrategy strategy) -> T & { - // HALIDE_ATTRIBUTE_DEPRECATED("Call prefetch() with the two-var form instead.") - PyErr_WarnEx(PyExc_DeprecationWarning, - "Call prefetch() with the two-var form instead.", - 1); - // Templated function; specializing only on ImageParam for now - return t.template prefetch(image, var, var, offset, strategy); - }, - py::arg("image"), py::arg("var"), py::arg("offset") = 1, py::arg("strategy") = PrefetchBoundStrategy::GuardWithIf) - .def("prefetch", (T & (T::*)(const Func &, const VarOrRVar &, const VarOrRVar &, Expr, PrefetchBoundStrategy)) & T::prefetch, py::arg("func"), py::arg("at"), py::arg("from"), py::arg("offset") = 1, py::arg("strategy") = PrefetchBoundStrategy::GuardWithIf) .def( "prefetch", [](T &t, const ImageParam &image, const VarOrRVar &at, const VarOrRVar &from, const Expr &offset, PrefetchBoundStrategy strategy) -> T & { diff --git a/src/Func.h b/src/Func.h index 589e18709586..b7c7f1250e96 100644 --- a/src/Func.h +++ b/src/Func.h @@ -441,22 +441,6 @@ class Stage { Stage &hexagon(const VarOrRVar &x = Var::outermost()); - HALIDE_ATTRIBUTE_DEPRECATED("Call prefetch() with the two-var form instead.") - Stage &prefetch(const Func &f, const VarOrRVar &var, int offset = 1, - PrefetchBoundStrategy strategy = PrefetchBoundStrategy::GuardWithIf) { - return prefetch(f, var, var, offset, strategy); - } - HALIDE_ATTRIBUTE_DEPRECATED("Call prefetch() with the two-var form instead.") - Stage &prefetch(const Internal::Parameter ¶m, const VarOrRVar &var, int offset = 1, - PrefetchBoundStrategy strategy = PrefetchBoundStrategy::GuardWithIf) { - return prefetch(param, var, var, offset, strategy); - } - template - HALIDE_ATTRIBUTE_DEPRECATED("Call prefetch() with the two-var form instead.") - Stage &prefetch(const T &image, VarOrRVar var, int offset = 1, - PrefetchBoundStrategy strategy = PrefetchBoundStrategy::GuardWithIf) { - return prefetch(image.parameter(), var, var, offset, strategy); - } Stage &prefetch(const Func &f, const VarOrRVar &at, const VarOrRVar &from, Expr offset = 1, PrefetchBoundStrategy strategy = PrefetchBoundStrategy::GuardWithIf); Stage &prefetch(const Internal::Parameter ¶m, const VarOrRVar &at, const VarOrRVar &from, Expr offset = 1, @@ -1941,55 +1925,7 @@ class Func { Func &hexagon(const VarOrRVar &x = Var::outermost()); /** Prefetch data written to or read from a Func or an ImageParam by a - * subsequent loop iteration, at an optionally specified iteration offset. - * 'var' specifies at which loop level the prefetch calls should be inserted. - * The final argument specifies how prefetch of region outside bounds - * should be handled. - * - * For example, consider this pipeline: - \code - Func f, g; - Var x, y; - f(x, y) = x + y; - g(x, y) = 2 * f(x, y); - \endcode - * - * The following schedule: - \code - f.compute_root(); - g.prefetch(f, x, 2, PrefetchBoundStrategy::NonFaulting); - \endcode - * - * will inject prefetch call at the innermost loop of 'g' and generate - * the following loop nest: - * for y = ... - * for x = ... - * f(x, y) = x + y - * for y = .. - * for x = ... - * prefetch(&f[x + 2, y], 1, 16); - * g(x, y) = 2 * f(x, y) - */ - // @{ - HALIDE_ATTRIBUTE_DEPRECATED("Call prefetch() with the two-var form instead.") - Func &prefetch(const Func &f, const VarOrRVar &var, int offset = 1, - PrefetchBoundStrategy strategy = PrefetchBoundStrategy::GuardWithIf) { - return prefetch(f, var, var, offset, strategy); - } - HALIDE_ATTRIBUTE_DEPRECATED("Call prefetch() with the two-var form instead.") - Func &prefetch(const Internal::Parameter ¶m, const VarOrRVar &var, int offset = 1, - PrefetchBoundStrategy strategy = PrefetchBoundStrategy::GuardWithIf) { - return prefetch(param, var, var, offset, strategy); - } - template - HALIDE_ATTRIBUTE_DEPRECATED("Call prefetch() with the two-var form instead.") - Func &prefetch(const T &image, VarOrRVar var, int offset = 1, - PrefetchBoundStrategy strategy = PrefetchBoundStrategy::GuardWithIf) { - return prefetch(image, var, var, offset, strategy); - } - // @} - - /** prefetch() is a more fine-grained version of prefetch(), which allows + * subsequent loop iteration, at an optionally specified iteration offset. You may specify * specification of different vars for the location of the prefetch() instruction * vs. the location that is being prefetched: * @@ -2000,6 +1936,9 @@ class Func { * If 'at' and 'from' are distinct vars, then 'from' must be at a nesting level outside 'at.' * Note that the value for 'offset' applies only to 'from', not 'at'. * + * The final argument specifies how prefetch of region outside bounds + * should be handled. + * * For example, consider this pipeline: \code Func f, g;