Loading...
Searching...
No Matches
ClampUnsafeAccesses.h
Go to the documentation of this file.
#ifndef HALIDE_CLAMPUNSAFEACCESSES_H
#define HALIDE_CLAMPUNSAFEACCESSES_H
/** \file
* Defines the clamp_unsafe_accesses lowering pass.
*/
#include "Bounds.h"
#include "Expr.h"
#include "Function.h"
namespace Halide::Internal {
/** Inject clamps around func calls h(...) when all the following conditions hold:
* 1. The call is in an indexing context, such as: f(x) = g(h(x));
* 2. The FuncValueBounds of h are smaller than those of its type
* 3. The allocation bounds of h might be wider than its compute bounds.
*/
Stmt clamp_unsafe_accesses(const Stmt &s, const std::map<std::string, Function> &env, FuncValueBounds &func_bounds);
} // namespace Halide::Internal
#endif // HALIDE_CLAMPUNSAFEACCESSES_H
Bounds.h
Methods for computing the upper and lower bounds of an expression, and the regions of a function read...
Expr.h
Base classes for Halide expressions (Halide::Expr) and statements (Halide::Internal::Stmt).
Function.h
Defines the internal representation of a halide function and related classes.
Halide::Internal
Definition AbstractGenerator.h:24
Halide::Internal::clamp_unsafe_accesses
Stmt clamp_unsafe_accesses(const Stmt &s, const std::map< std::string, Function > &env, FuncValueBounds &func_bounds)
Inject clamps around func calls h(...) when all the following conditions hold:
Halide::Internal::FuncValueBounds
std::map< std::pair< std::string, int >, Interval > FuncValueBounds
Definition Bounds.h:17
Halide::Internal::Stmt
A reference-counted handle to a statement node.
Definition Expr.h:427