Loading...
Searching...
No Matches
InferArguments.h
Go to the documentation of this file.
#ifndef HALIDE_INFER_ARGUMENTS_H
#define HALIDE_INFER_ARGUMENTS_H
#include <vector>
#include "Argument.h"
#include "Buffer.h"
#include "Expr.h"
#include "Parameter.h"
/** \file
*
* Interface for a visitor to infer arguments used in a body Stmt.
*/
namespace Halide {
namespace Internal {
/** An inferred argument. Inferred args are either Params,
* ImageParams, or Buffers. The first two are handled by the param
* field, and global images are tracked via the buf field. These
* are used directly when jitting, or used for validation when
* compiling with an explicit argument list. */
struct InferredArgument {
Argument arg;
Parameter param;
Buffer<> buffer;
bool operator<(const InferredArgument &other) const {
if (arg.is_buffer() && !other.arg.is_buffer()) {
return true;
} else if (other.arg.is_buffer() && !arg.is_buffer()) {
return false;
} else {
return arg.name < other.arg.name;
}
}
};
class Function;
std::vector<InferredArgument> infer_arguments(const Stmt &body, const std::vector<Function> &outputs);
} // namespace Internal
} // namespace Halide
#endif
Argument.h
Defines a type used for expressing the type signature of a generated halide pipeline.
Buffer.h
Expr.h
Base classes for Halide expressions (Halide::Expr) and statements (Halide::Internal::Stmt).
Parameter.h
Defines the internal representation of parameters to halide piplines.
Halide::Buffer<>
Halide::Parameter
A reference-counted handle to a parameter to a halide pipeline.
Definition Parameter.h:40
Halide::Internal
Definition AbstractGenerator.h:24
Halide::Internal::ArgInfoKind::Function
@ Function
Definition AbstractGenerator.h:27
Halide::Internal::infer_arguments
std::vector< InferredArgument > infer_arguments(const Stmt &body, const std::vector< Function > &outputs)
Halide
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
Definition AbstractGenerator.h:19
Halide::Argument
A struct representing an argument to a halide-generated function.
Definition Argument.h:37
Halide::Argument::is_buffer
bool is_buffer() const
Definition Argument.h:89
Halide::Argument::name
std::string name
The name of the argument.
Definition Argument.h:39
Halide::Internal::InferredArgument
An inferred argument.
Definition InferArguments.h:24
Halide::Internal::InferredArgument::buffer
Buffer buffer
Definition InferArguments.h:27
Halide::Internal::InferredArgument::arg
Argument arg
Definition InferArguments.h:25
Halide::Internal::InferredArgument::operator<
bool operator<(const InferredArgument &other) const
Definition InferArguments.h:29
Halide::Internal::InferredArgument::param
Parameter param
Definition InferArguments.h:26
Halide::Internal::Stmt
A reference-counted handle to a statement node.
Definition Expr.h:427