Halide 22.0.0 Halide compiler and libraries

Loading...
Searching...
No Matches
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 "ConstantInterval.h"
12#include "Scope.h"
13
14 namespace Halide {
15 namespace Internal {
16
17/** Find the bounds of the derivative of an expression. The scope gives the
18 * bounds on the derivatives of any variables found. */
19 ConstantInterval derivative_bounds(const Expr &e, const std::string &var,
20 const Scope<ConstantInterval> &scope = Scope<ConstantInterval>::empty_scope());
21
22/**
23 * Detect whether an expression is monotonic increasing in a variable,
24 * decreasing, or unknown.
25 */
26 enum class Monotonic { Constant,
27 Increasing,
28 Decreasing,
29 Unknown };
30 Monotonic is_monotonic(const Expr &e, const std::string &var,
31 const Scope<ConstantInterval> &scope = Scope<ConstantInterval>::empty_scope());
32 Monotonic is_monotonic(const Expr &e, const std::string &var, const Scope<Monotonic> &scope);
33
34/** Emit the monotonic class in human-readable form for debugging. */
35std::ostream &operator<<(std::ostream &stream, const Monotonic &m);
36
37 void is_monotonic_test();
38
39} // namespace Internal
40} // namespace Halide
41
42#endif
ConstantInterval.h
Defines the ConstantInterval class, and operators on it.
Scope.h
Defines the Scope class, which is used for keeping track of names in a scope while traversing IR.
Halide::Internal::Scope
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
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::Internal::is_monotonic
Monotonic is_monotonic(const Expr &e, const std::string &var, const Scope< ConstantInterval > &scope=Scope< ConstantInterval >::empty_scope())
Halide::Internal::Monotonic
Monotonic
Detect whether an expression is monotonic increasing in a variable, decreasing, or unknown.
Definition Monotonic.h:26
Halide::Internal::Monotonic::Decreasing
@ Decreasing
Halide::Internal::Monotonic::Unknown
@ Unknown
Halide::Internal::Monotonic::Constant
@ Constant
Halide::Internal::Monotonic::Increasing
@ Increasing
Halide::Internal::operator<<
ConstantInterval operator<<(const ConstantInterval &a, const ConstantInterval &b)
Halide::Internal::is_monotonic_test
void is_monotonic_test()
Halide
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
Definition AbstractGenerator.h:19
Halide::LinkageType::Internal
@ Internal
Not visible externally, similar to 'static' linkage in C.
Halide::cast
Internal::ConstantInterval cast(Type t, const Internal::ConstantInterval &a)
Cast operators for ConstantIntervals.
Halide::Expr
A fragment of Halide syntax.
Definition Expr.h:258
Halide::Internal::ConstantInterval
A class to represent ranges of integers.
Definition ConstantInterval.h:18