Halide 19.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
13namespace Halide {
14namespace Internal {
15
16class 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 */
31Stmt storage_folding(const Stmt &s, const std::map<std::string, Function> &env);
32
33} // namespace Internal
34} // namespace Halide
35
36#endif
Base classes for Halide expressions (Halide::Expr) and statements (Halide::Internal::Stmt)
Stmt storage_folding(const Stmt &s, const std::map< std::string, Function > &env)
Fold storage of functions if possible.
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
@ Internal
Not visible externally, similar to 'static' linkage in C.
A reference-counted handle to a statement node.
Definition Expr.h:427