Halide
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,
19  const Scope<ConstantInterval> &scope = Scope<ConstantInterval>::empty_scope());
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,
30  const Scope<ConstantInterval> &scope = Scope<ConstantInterval>::empty_scope());
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 
36 void is_monotonic_test();
37 
38 } // namespace Internal
39 } // namespace Halide
40 
41 #endif
Scope.h
Halide::Internal::Monotonic::Unknown
@ Unknown
Halide::Internal::Monotonic::Increasing
@ Increasing
Halide::Internal::Monotonic::Constant
@ Constant
Halide::Internal::operator<<
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.
Halide::Internal::Monotonic::Decreasing
@ Decreasing
Halide::Internal::Monotonic
Monotonic
Detect whether an expression is monotonic increasing in a variable, decreasing, or unknown.
Definition: Monotonic.h:25
Halide
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
Definition: AbstractGenerator.h:19
Halide::Internal::derivative_bounds
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.
Halide::LinkageType::Internal
@ Internal
Not visible externally, similar to 'static' linkage in C.
Halide::Internal::is_monotonic_test
void is_monotonic_test()
Halide::Internal::is_monotonic
Monotonic is_monotonic(const Expr &e, const std::string &var, const Scope< ConstantInterval > &scope=Scope< ConstantInterval >::empty_scope())
Halide::Internal::Scope::empty_scope
static const Scope< T > & empty_scope()
A const ref to an empty scope.
Definition: Scope.h:120
Halide::Expr
A fragment of Halide syntax.
Definition: Expr.h:257
Interval.h