Halide
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 
12 #include "Expr.h"
13 
14 namespace Halide {
15 namespace Internal {
16 
17 class Function;
18 
19 /** Construct a map from name to Function definition object for all Halide
20  * functions called directly in the definition of the Function f, including
21  * in update definitions, update index expressions, and RDom extents. This map
22  * _does not_ include the Function f, unless it is called recursively by
23  * itself.
24  */
25 std::map<std::string, Function> find_direct_calls(Function f);
26 
27 /** Construct a map from name to Function definition object for all Halide
28  * functions called directly in the definition of the Function f, or
29  * indirectly in those functions' definitions, recursively. This map always
30  * _includes_ the Function f.
31  */
32 std::map<std::string, Function> find_transitive_calls(Function f);
33 
34 /** Find all Functions transitively referenced by f in any way and add
35  * them to the given map. */
36 void populate_environment(Function f, std::map<std::string, Function> &env);
37 
38 } // namespace Internal
39 } // namespace Halide
40 
41 #endif
Halide
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
Definition: AddAtomicMutex.h:21
Halide::LinkageType::Internal
@ Internal
Not visible externally, similar to 'static' linkage in C.
Halide::Internal::IOKind::Function
@ Function
Expr.h
Halide::Internal::find_transitive_calls
std::map< std::string, Function > find_transitive_calls(Function f)
Construct a map from name to Function definition object for all Halide functions called directly in t...
Halide::Internal::populate_environment
void populate_environment(Function f, std::map< std::string, Function > &env)
Find all Functions transitively referenced by f in any way and add them to the given map.
Halide::Internal::find_direct_calls
std::map< std::string, Function > find_direct_calls(Function f)
Construct a map from name to Function definition object for all Halide functions called directly in t...