Halide 19.0.0
Halide compiler and libraries
Loading...
Searching...
No Matches
Halide::GeneratorParam< T > Class Template Reference

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

#include <Generator.h>

Inheritance diagram for Halide::GeneratorParam< T >:

Public Member Functions

template<typename T2 = T, typename std::enable_if<!std::is_same< T2, std::string >::value >::type * = nullptr>
 GeneratorParam (const std::string &name, const T &value)
 
 GeneratorParam (const std::string &name, const T &value, const T &min, const T &max)
 
 GeneratorParam (const std::string &name, const T &value, const std::map< std::string, T > &enum_map)
 
 GeneratorParam (const std::string &name, const std::string &value)
 

Detailed Description

template<typename T>
class Halide::GeneratorParam< 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.

Examples
tutorial/lesson_15_generators.cpp.

Definition at line 989 of file Generator.h.

Constructor & Destructor Documentation

◆ GeneratorParam() [1/4]

template<typename T >
template<typename T2 = T, typename std::enable_if<!std::is_same< T2, std::string >::value >::type * = nullptr>
Halide::GeneratorParam< T >::GeneratorParam ( const std::string & name,
const T & value )
inline

Definition at line 992 of file Generator.h.

References Halide::Internal.

◆ GeneratorParam() [2/4]

template<typename T >
Halide::GeneratorParam< T >::GeneratorParam ( const std::string & name,
const T & value,
const T & min,
const T & max )
inline

Definition at line 996 of file Generator.h.

References Halide::Internal.

◆ GeneratorParam() [3/4]

template<typename T >
Halide::GeneratorParam< T >::GeneratorParam ( const std::string & name,
const T & value,
const std::map< std::string, T > & enum_map )
inline

Definition at line 1000 of file Generator.h.

References Halide::Internal.

◆ GeneratorParam() [4/4]

template<typename T >
Halide::GeneratorParam< T >::GeneratorParam ( const std::string & name,
const std::string & value )
inline

Definition at line 1004 of file Generator.h.

References Halide::Internal.


The documentation for this class was generated from the following file: