Halide 19.0.0
Halide compiler and libraries
Loading...
Searching...
No Matches
ExternFuncArgument.h
Go to the documentation of this file.
1#ifndef HALIDE_EXTERNFUNCARGUMENT_H
2#define HALIDE_EXTERNFUNCARGUMENT_H
3
4/** \file
5 * Defines the internal representation of a halide ExternFuncArgument
6 */
7
8#include "Buffer.h"
9#include "Expr.h"
10#include "FunctionPtr.h"
11#include "Parameter.h"
12
13namespace Halide {
14
15/** An argument to an extern-defined Func. May be a Function, Buffer,
16 * ImageParam or Expr. */
28
32
33 template<typename T, int Dims>
38 : arg_type(ExprArg), expr(std::move(e)) {
39 }
41 : arg_type(ExprArg), expr(e) {
42 }
44 : arg_type(ExprArg), expr(e) {
45 }
46
49 // Scalar params come in via the Expr constructor.
51 }
52 ExternFuncArgument() = default;
53
54 bool is_func() const {
55 return arg_type == FuncArg;
56 }
57 bool is_expr() const {
58 return arg_type == ExprArg;
59 }
60 bool is_buffer() const {
61 return arg_type == BufferArg;
62 }
63 bool is_image_param() const {
64 return arg_type == ImageParamArg;
65 }
66 bool defined() const {
67 return arg_type != UndefinedArg;
68 }
69};
70
71} // namespace Halide
72
73#endif // HALIDE_EXTERNFUNCARGUMENT_H
#define internal_assert(c)
Definition Errors.h:19
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
bool is_buffer() const
Does this parameter refer to a buffer/image?
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
A fragment of Halide syntax.
Definition Expr.h:258
An argument to an extern-defined Func.
ExternFuncArgument(const Parameter &p)
ExternFuncArgument(Internal::FunctionPtr f)
ExternFuncArgument(Buffer< T, Dims > b)
Internal::FunctionPtr func
A possibly-weak pointer to a Halide function.
Definition FunctionPtr.h:27