Halide
InferArguments.h
Go to the documentation of this file.
1 #ifndef HALIDE_INFER_ARGUMENTS_H
2 #define HALIDE_INFER_ARGUMENTS_H
3 
4 #include <vector>
5 
6 #include "Argument.h"
7 #include "Buffer.h"
8 #include "Expr.h"
9 #include "Parameter.h"
10 
11 /** \file
12  *
13  * Interface for a visitor to infer arguments used in a body Stmt.
14  */
15 
16 namespace Halide {
17 namespace Internal {
18 
19 /** An inferred argument. Inferred args are either Params,
20  * ImageParams, or Buffers. The first two are handled by the param
21  * field, and global images are tracked via the buf field. These
22  * are used directly when jitting, or used for validation when
23  * compiling with an explicit argument list. */
28 
29  bool operator<(const InferredArgument &other) const {
30  if (arg.is_buffer() && !other.arg.is_buffer()) {
31  return true;
32  } else if (other.arg.is_buffer() && !arg.is_buffer()) {
33  return false;
34  } else {
35  return arg.name < other.arg.name;
36  }
37  }
38 };
39 
40 class Function;
41 
42 std::vector<InferredArgument> infer_arguments(const Stmt &body, const std::vector<Function> &outputs);
43 
44 } // namespace Internal
45 } // namespace Halide
46 
47 #endif
Parameter.h
Halide::Internal::Parameter
A reference-counted handle to a parameter to a halide pipeline.
Definition: Parameter.h:28
Halide::Argument
A struct representing an argument to a halide-generated function.
Definition: Argument.h:37
Halide::Internal::InferredArgument::arg
Argument arg
Definition: InferArguments.h:25
Halide
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
Definition: AbstractGenerator.h:19
Halide::Internal::infer_arguments
std::vector< InferredArgument > infer_arguments(const Stmt &body, const std::vector< Function > &outputs)
Halide::LinkageType::Internal
@ Internal
Not visible externally, similar to 'static' linkage in C.
Argument.h
Halide::Internal::InferredArgument
An inferred argument.
Definition: InferArguments.h:24
Halide::Buffer<>
Buffer.h
Halide::Internal::InferredArgument::buffer
Buffer buffer
Definition: InferArguments.h:27
Halide::Argument::name
std::string name
The name of the argument.
Definition: Argument.h:39
Expr.h
Halide::Argument::is_buffer
bool is_buffer() const
Definition: Argument.h:89
Halide::Internal::InferredArgument::operator<
bool operator<(const InferredArgument &other) const
Definition: InferArguments.h:29
Halide::Internal::InferredArgument::param
Parameter param
Definition: InferArguments.h:26