Halide  12.0.1
Halide compiler and libraries
Monotonic.h
Go to the documentation of this file.
1 #ifndef HALIDE_MONOTONIC_H
2 #define HALIDE_MONOTONIC_H
3 
4 /** \file
5  *
6  * Methods for computing whether expressions are monotonic
7  */
8 #include <iostream>
9 #include <string>
10 
11 #include "Interval.h"
12 #include "Scope.h"
13 
14 namespace Halide {
15 namespace Internal {
16 
17 /** Find the bounds of the derivative of an expression. */
18 ConstantInterval derivative_bounds(const Expr &e, const std::string &var,
20 
21 /**
22  * Detect whether an expression is monotonic increasing in a variable,
23  * decreasing, or unknown.
24  */
25 enum class Monotonic { Constant,
26  Increasing,
27  Decreasing,
28  Unknown };
29 Monotonic is_monotonic(const Expr &e, const std::string &var,
31 Monotonic is_monotonic(const Expr &e, const std::string &var, const Scope<Monotonic> &scope);
32 
33 /** Emit the monotonic class in human-readable form for debugging. */
34 std::ostream &operator<<(std::ostream &stream, const Monotonic &m);
35 
37 
38 } // namespace Internal
39 } // namespace Halide
40 
41 #endif
Defines the Interval class.
Defines the Scope class, which is used for keeping track of names in a scope while traversing IR.
A common pattern when traversing Halide IR is that you need to keep track of stuff when you find a Le...
Definition: Scope.h:94
ConstantInterval derivative_bounds(const Expr &e, const std::string &var, const Scope< ConstantInterval > &scope=Scope< ConstantInterval >::empty_scope())
Find the bounds of the derivative of an expression.
Monotonic is_monotonic(const Expr &e, const std::string &var, const Scope< ConstantInterval > &scope=Scope< ConstantInterval >::empty_scope())
Monotonic
Detect whether an expression is monotonic increasing in a variable, decreasing, or unknown.
Definition: Monotonic.h:25
std::ostream & operator<<(std::ostream &stream, const Stmt &)
Emit a halide statement on an output stream (such as std::cout) in a human-readable form.
void is_monotonic_test()
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
@ Internal
Not visible externally, similar to 'static' linkage in C.
A fragment of Halide syntax.
Definition: Expr.h:256
A class to represent ranges of integers.
Definition: Interval.h:115