Halide  13.0.2
Halide compiler and libraries
FindCalls.h
Go to the documentation of this file.
1 #ifndef FIND_CALLS_H
2 #define FIND_CALLS_H
3 
4 /** \file
5  *
6  * Defines analyses to extract the functions called a function.
7  */
8 
9 #include <map>
10 #include <string>
11 #include <vector>
12 
13 #include "Expr.h"
14 
15 namespace Halide {
16 namespace Internal {
17 
18 class Function;
19 
20 /** Construct a map from name to Function definition object for all Halide
21  * functions called directly in the definition of the Function f, including
22  * in update definitions, update index expressions, and RDom extents. This map
23  * _does not_ include the Function f, unless it is called recursively by
24  * itself.
25  */
26 std::map<std::string, Function> find_direct_calls(const Function &f);
27 
28 /** Construct a map from name to Function definition object for all Halide
29  * functions called directly in the definition of the Function f, or
30  * indirectly in those functions' definitions, recursively. This map always
31  * _includes_ the Function f.
32  */
33 std::map<std::string, Function> find_transitive_calls(const Function &f);
34 
35 /** Find all Functions transitively referenced by any Function in `funcs` and return
36  * a map of them. */
37 std::map<std::string, Function> build_environment(const std::vector<Function> &funcs);
38 
39 } // namespace Internal
40 } // namespace Halide
41 
42 #endif
Base classes for Halide expressions (Halide::Expr) and statements (Halide::Internal::Stmt)
A reference-counted handle to Halide's internal representation of a function.
Definition: Function.h:38
std::map< std::string, Function > build_environment(const std::vector< Function > &funcs)
Find all Functions transitively referenced by any Function in funcs and return a map of them.
std::map< std::string, Function > find_transitive_calls(const Function &f)
Construct a map from name to Function definition object for all Halide functions called directly in t...
std::map< std::string, Function > find_direct_calls(const Function &f)
Construct a map from name to Function definition object for all Halide functions called directly in t...
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
@ Internal
Not visible externally, similar to 'static' linkage in C.