Loading...
Searching...
No Matches
Memoization.h
Go to the documentation of this file.
#ifndef HALIDE_INTERNAL_CACHING_H
#define HALIDE_INTERNAL_CACHING_H
/** \file
*
* Defines the interface to the pass that injects support for
* compute_cached roots.
*/
#include <map>
#include <string>
#include "Expr.h"
namespace Halide {
namespace Internal {
class Function;
/** Transform pipeline calls for Funcs scheduled with memoize to do a
* lookup call to the runtime cache implementation, and if there is a
* miss, compute the results and call the runtime to store it back to
* the cache.
* Should leave non-memoized Funcs unchanged.
*/
Stmt inject_memoization(const Stmt &s, const std::map<std::string, Function> &env,
const std::string &name,
const std::vector<Function> &outputs);
/** This should be called after Storage Flattening has added Allocation
* IR nodes. It connects the memoization cache lookups to the Allocations
* so they point to the buffers from the memoization cache and those buffers
* are released when no longer used.
* Should not affect allocations for non-memoized Funcs.
*/
Stmt rewrite_memoized_allocations(const Stmt &s, const std::map<std::string, Function> &env);
} // namespace Internal
} // namespace Halide
#endif
Expr.h
Base classes for Halide expressions (Halide::Expr) and statements (Halide::Internal::Stmt).
Halide::Internal::Function
A reference-counted handle to Halide's internal representation of a function.
Definition Function.h:39
Halide::Internal
Definition AbstractGenerator.h:24
Halide::Internal::inject_memoization
Stmt inject_memoization(const Stmt &s, const std::map< std::string, Function > &env, const std::string &name, const std::vector< Function > &outputs)
Transform pipeline calls for Funcs scheduled with memoize to do a lookup call to the runtime cache im...
Halide::Internal::rewrite_memoized_allocations
Stmt rewrite_memoized_allocations(const Stmt &s, const std::map< std::string, Function > &env)
This should be called after Storage Flattening has added Allocation IR nodes.
Halide
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
Definition AbstractGenerator.h:19
Halide::Internal::Stmt
A reference-counted handle to a statement node.
Definition Expr.h:427