GeneratorParam#

template<typename T>
class GeneratorParam : public Internal::GeneratorParamImplBase<T>#

GeneratorParam is a templated class that can be used to modify the behavior of the Generator at code-generation time.

GeneratorParams are commonly specified in build files (e.g. Makefile) to customize the behavior of a given Generator, thus they have a very constrained set of types to allow for efficient specification via command-line flags. A GeneratorParam can be:

  • any float or int type.

  • bool

  • enum

  • Halide::Target

  • Halide::Type

  • std::string Please don’t use std::string unless there’s no way to do what you want with some other type; in particular, don’t use this if you can use enum instead. All GeneratorParams have a default value. Arithmetic types can also optionally specify min and max. Enum types must specify a string-to-value map.

Halide::Type is treated as though it were an enum, with the mappings:

“int8” Halide::Int(8) “int16” Halide::Int(16) “int32” Halide::Int(32) “int64” Halide::Int(64) “uint8” Halide::UInt(8) “uint16” Halide::UInt(16) “uint32” Halide::UInt(32) “uint64” Halide::UInt(64) “float16” Halide::Float(16) “float32” Halide::Float(32) “float64” Halide::Float(64) “bfloat16” Halide::BFloat(16)

No vector Types are currently supported by this mapping.