Argument#

struct Argument#

A struct representing an argument to a halide-generated function.

Used for specifying the function signature of generated code.

Subclassed by Halide::Internal::LoweredArgument

Public Types

enum Kind#

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.

Values:

enumerator InputScalar#
enumerator InputBuffer#
enumerator OutputBuffer#

Public Members

std::string name#

The name of the argument.

uint8_t 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)

Type 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.