Halide 19.0.0
Halide compiler and libraries
Loading...
Searching...
No Matches
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
16namespace Halide {
17namespace 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
40class Function;
41
42std::vector<InferredArgument> infer_arguments(const Stmt &body, const std::vector<Function> &outputs);
43
44} // namespace Internal
45} // namespace Halide
46
47#endif
Defines a type used for expressing the type signature of a generated halide pipeline.
Base classes for Halide expressions (Halide::Expr) and statements (Halide::Internal::Stmt)
Defines the internal representation of parameters to halide piplines.
A reference-counted handle to a parameter to a halide pipeline.
Definition Parameter.h:40
std::vector< InferredArgument > infer_arguments(const Stmt &body, const std::vector< Function > &outputs)
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 struct representing an argument to a halide-generated function.
Definition Argument.h:37
bool is_buffer() const
Definition Argument.h:89
std::string name
The name of the argument.
Definition Argument.h:39
bool operator<(const InferredArgument &other) const
A reference-counted handle to a statement node.
Definition Expr.h:427