TVM  0.9.4
Option.h File Reference
#include <optional>
#include <type_traits>
Include dependency graph for Option.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define TVM_ADD_OPTION_GET_SET(optionName, type)
 
#define TVM_ADD_DEFAULT_OPTION(optionName, type)
 
#define TVM_ADD_NON_DEFAULT_OPTION(optionName, defaultValue)
 
#define TVM_PROCESS_OPTION_2(optionName, target, setterName)
 
#define TVM_PROCESS_OPTION(optionName, target)   TVM_PROCESS_OPTION_2(optionName, target, optionName)
 
#define TVM_PROCESS_OPTION_PUBLIC_ACCESS_2(optionName, target, fieldName)
 
#define TVM_PROCESS_OPTION_PUBLIC_ACCESS(optionName, target)    TVM_PROCESS_OPTION_PUBLIC_ACCESS_2(optionName, target, optionName)
 

Macro Definition Documentation

◆ TVM_ADD_DEFAULT_OPTION

#define TVM_ADD_DEFAULT_OPTION (   optionName,
  type 
)
Value:
private: \
using optionName##_t = type; \
std::optional<type> optionName##_; \
TVM_ADD_OPTION_GET_SET(optionName, type)

Adding an option optionName of type type with no default value. The default value of the underlying solver will be used.

◆ TVM_ADD_NON_DEFAULT_OPTION

#define TVM_ADD_NON_DEFAULT_OPTION (   optionName,
  defaultValue 
)
Value:
private: \
using optionName##_t = std::remove_const_t<decltype(defaultValue)>; \
std::optional<optionName##_t> optionName##_ = defaultValue; \
TVM_ADD_OPTION_GET_SET(optionName, optionName##_t)

Adding an option optionName with new default value defaultValue, that will replace the value of the underlying solver.

◆ TVM_ADD_OPTION_GET_SET

#define TVM_ADD_OPTION_GET_SET (   optionName,
  type 
)
Value:
public: \
const std::optional<type> & optionName() const { return optionName##_; } \
auto & optionName(const type & v) \
{ \
optionName##_ = v; \
return *this; \
}

Copyright 2017-2020 CNRS-AIST JRL and CNRS-UM LIRMM Adding getter and setter for the option optionName of type type.

◆ TVM_PROCESS_OPTION

#define TVM_PROCESS_OPTION (   optionName,
  target 
)    TVM_PROCESS_OPTION_2(optionName, target, optionName)

Specialized version of TVM_PROCESS_OPTION_2 where setterName = optionName.

◆ TVM_PROCESS_OPTION_2

#define TVM_PROCESS_OPTION_2 (   optionName,
  target,
  setterName 
)
Value:
if(options.optionName()) \
target.setterName(options.optionName().value());

Process optionName: if optionName has a non-default value, use target.setterName to set that value for target.

◆ TVM_PROCESS_OPTION_PUBLIC_ACCESS

#define TVM_PROCESS_OPTION_PUBLIC_ACCESS (   optionName,
  target 
)     TVM_PROCESS_OPTION_PUBLIC_ACCESS_2(optionName, target, optionName)

Specialized version of TVM_PROCESS_OPTION_PUBLIC_ACCESS_2 where fieldName = optionName.

◆ TVM_PROCESS_OPTION_PUBLIC_ACCESS_2

#define TVM_PROCESS_OPTION_PUBLIC_ACCESS_2 (   optionName,
  target,
  fieldName 
)
Value:
if(options.optionName()) \
target.fieldName = options.optionName().value();

Process optionName: if optionName has a non-default value, set target.fieldName to set that value.