Halide 19.0.0
Halide compiler and libraries
|
A struct representing an argument to a halide-generated function. More...
#include <Argument.h>
Public Types | |
enum | Kind { InputScalar = halide_argument_kind_input_scalar , InputBuffer = halide_argument_kind_input_buffer , OutputBuffer = halide_argument_kind_output_buffer } |
An argument is either a primitive type (for parameters), or a buffer pointer. More... | |
Public Member Functions | |
Argument ()=default | |
Argument (const std::string &_name, Kind _kind, const Type &_type, int _dimensions, const ArgumentEstimates &argument_estimates) | |
template<typename T , int Dims> | |
Argument (Buffer< T, Dims > im) | |
bool | is_buffer () const |
bool | is_scalar () const |
bool | is_input () const |
bool | is_output () const |
bool | operator== (const Argument &rhs) const |
Public Attributes | |
std::string | name |
The name of the argument. | |
Kind | kind = InputScalar |
uint8_t | dimensions = 0 |
If kind == InputBuffer|OutputBuffer, this is the dimensionality of the buffer. | |
Type | type |
If this is a scalar parameter, then this is its type. | |
ArgumentEstimates | argument_estimates |
A struct representing an argument to a halide-generated function.
Used for specifying the function signature of generated code.
Definition at line 37 of file Argument.h.
An argument is either a primitive type (for parameters), or a buffer pointer.
If kind == InputScalar, then type fully encodes the expected type of the scalar argument.
If kind == InputBuffer|OutputBuffer, then type.bytes() should be used to determine* elem_size of the buffer; additionally, type.code should reflect the expected interpretation of the buffer data (e.g. float vs int), but there is no runtime enforcement of this at present.
Enumerator | |
---|---|
InputScalar | |
InputBuffer | |
OutputBuffer |
Definition at line 52 of file Argument.h.
|
default |
Halide::Argument::Argument | ( | const std::string & | _name, |
Kind | _kind, | ||
const Type & | _type, | ||
int | _dimensions, | ||
const ArgumentEstimates & | argument_estimates ) |
|
inline |
Definition at line 82 of file Argument.h.
|
inline |
Definition at line 89 of file Argument.h.
References InputBuffer, kind, and OutputBuffer.
Referenced by Halide::Internal::InferredArgument::operator<().
|
inline |
Definition at line 92 of file Argument.h.
References InputScalar, and kind.
|
inline |
Definition at line 96 of file Argument.h.
References InputBuffer, InputScalar, and kind.
|
inline |
Definition at line 99 of file Argument.h.
References kind, and OutputBuffer.
|
inline |
Definition at line 103 of file Argument.h.
References argument_estimates, dimensions, kind, name, and type.
std::string Halide::Argument::name |
The name of the argument.
Definition at line 39 of file Argument.h.
Referenced by Halide::Internal::InferredArgument::operator<(), and operator==().
Kind Halide::Argument::kind = InputScalar |
Definition at line 57 of file Argument.h.
Referenced by is_buffer(), is_input(), is_output(), is_scalar(), and operator==().
uint8_t Halide::Argument::dimensions = 0 |
If kind == InputBuffer|OutputBuffer, this is the dimensionality of the buffer.
If kind == InputScalar, this value is ignored (and should always be set to zero)
Definition at line 61 of file Argument.h.
Referenced by operator==().
Type Halide::Argument::type |
If this is a scalar parameter, then this is its type.
If this is a buffer parameter, this this is the type of its elements.
Note that type.lanes should always be 1 here.
Definition at line 69 of file Argument.h.
Referenced by operator==().
ArgumentEstimates Halide::Argument::argument_estimates |
Definition at line 72 of file Argument.h.
Referenced by operator==().