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 "Expr.h"
12 #include "Scope.h"
13 
14 namespace Halide {
15 namespace Internal {
16 
17 /**
18  * Detect whether an expression is monotonic increasing in a variable,
19  * decreasing, or unknown.
20  */
21 enum class Monotonic { Constant,
22  Increasing,
23  Decreasing,
24  Unknown };
25 Monotonic is_monotonic(const Expr &e, const std::string &var,
26  const Scope<Monotonic> &scope = Scope<Monotonic>::empty_scope());
27 
28 /** Emit the monotonic class in human-readable form for debugging. */
29 std::ostream &operator<<(std::ostream &stream, const Monotonic &m);
30 
31 void is_monotonic_test();
32 
33 } // namespace Internal
34 } // namespace Halide
35 
36 #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:21
Halide
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
Definition: AddAtomicMutex.h:21
Halide::LinkageType::Internal
@ Internal
Not visible externally, similar to 'static' linkage in C.
Halide::Internal::is_monotonic_test
void is_monotonic_test()
Expr.h
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:256
Halide::Internal::is_monotonic
Monotonic is_monotonic(const Expr &e, const std::string &var, const Scope< Monotonic > &scope=Scope< Monotonic >::empty_scope())