Halide
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>

Inherits GeneratorParamImplBase< 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) "uint8" Halide::UInt(8) "uint16" Halide::UInt(16) "uint32" Halide::UInt(32) "float32" Halide::Float(32) "float64" Halide::Float(64)

No vector Types are currently supported by this mapping.

Examples
tutorial/lesson_15_generators.cpp.

Definition at line 992 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 995 of file Generator.h.

◆ 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 999 of file Generator.h.

◆ 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 1003 of file Generator.h.

◆ GeneratorParam() [4/4]

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

Definition at line 1007 of file Generator.h.


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