Loading...
Searching...
No Matches
Monotonic.h
Go to the documentation of this file.
#ifndef HALIDE_MONOTONIC_H
#define HALIDE_MONOTONIC_H
/** \file
*
* Methods for computing whether expressions are monotonic
*/
#include <iostream>
#include <string>
#include "ConstantInterval.h"
#include "Scope.h"
namespace Halide {
namespace Internal {
/** Find the bounds of the derivative of an expression. The scope gives the
* bounds on the derivatives of any variables found. */
ConstantInterval derivative_bounds(const Expr &e, const std::string &var,
const Scope<ConstantInterval> &scope = Scope<ConstantInterval>::empty_scope());
/**
* Detect whether an expression is monotonic increasing in a variable,
* decreasing, or unknown.
*/
enum class Monotonic { Constant,
Increasing,
Decreasing,
Unknown };
Monotonic is_monotonic(const Expr &e, const std::string &var,
const Scope<ConstantInterval> &scope = Scope<ConstantInterval>::empty_scope());
Monotonic is_monotonic(const Expr &e, const std::string &var, const Scope<Monotonic> &scope);
/** Emit the monotonic class in human-readable form for debugging. */
std::ostream &operator<<(std::ostream &stream, const Monotonic &m);
void is_monotonic_test();
} // namespace Internal
} // namespace Halide
#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::Scope::empty_scope
static const Scope< T > & empty_scope()
A const ref to an empty scope.
Definition Scope.h:120
Halide::Internal
Definition AbstractGenerator.h:24
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
Definition Monotonic.h:28
Halide::Internal::Monotonic::Unknown
@ Unknown
Definition Monotonic.h:29
Halide::Internal::Monotonic::Constant
@ Constant
Definition Monotonic.h:26
Halide::Internal::Monotonic::Increasing
@ Increasing
Definition Monotonic.h:27
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::Expr
A fragment of Halide syntax.
Definition Expr.h:258
Halide::Internal::ConstantInterval
A class to represent ranges of integers.
Definition ConstantInterval.h:18