Halide 22.0.0 Halide compiler and libraries

Loading...
Searching...
No Matches
StorageFolding.h
Go to the documentation of this file.
1#ifndef HALIDE_STORAGE_FOLDING_H
2#define HALIDE_STORAGE_FOLDING_H
3
4/** \file
5 * Defines the lowering optimization pass that reduces large buffers
6 * down to smaller circular buffers when possible
7 */
8#include <map>
9#include <string>
10
11#include "Expr.h"
12
13 namespace Halide {
14 namespace Internal {
15
16 class Function;
17
18/** Fold storage of functions if possible. This means reducing one of
19 * the dimensions module something for the purpose of storage, if we
20 * can prove that this is safe to do. E.g consider:
21 *
22 \code
23 f(x) = ...
24 g(x) = f(x-1) + f(x)
25 f.store_root().compute_at(g, x);
26 \endcode
27 *
28 * We can store f as a circular buffer of size two, instead of
29 * allocating space for all of it.
30 */
31 Stmt storage_folding(const Stmt &s, const std::map<std::string, Function> &env);
32
33} // namespace Internal
34} // namespace Halide
35
36#endif
Expr.h
Base classes for Halide expressions (Halide::Expr) and statements (Halide::Internal::Stmt)
Halide::Internal::ArgInfoKind::Function
@ Function
Halide::Internal::storage_folding
Stmt storage_folding(const Stmt &s, const std::map< std::string, Function > &env)
Fold storage of functions if possible.
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::Internal::Stmt
A reference-counted handle to a statement node.
Definition Expr.h:427