// automatically generated by the FlatBuffers compiler, do not modify


#ifndef FLATBUFFERS_GENERATED_KNOBVALUE_HIPDNN_DATA_SDK_DATA_OBJECTS_H_
#define FLATBUFFERS_GENERATED_KNOBVALUE_HIPDNN_DATA_SDK_DATA_OBJECTS_H_

#include "flatbuffers/flatbuffers.h"

// Ensure the included flatbuffers.h is the same version as when this file was
// generated, otherwise it may not be compatible.
static_assert(FLATBUFFERS_VERSION_MAJOR == 25 &&
              FLATBUFFERS_VERSION_MINOR == 9 &&
              FLATBUFFERS_VERSION_REVISION == 23,
             "Non-compatible flatbuffers version included");

namespace hipdnn_data_sdk {
namespace data_objects {

struct IntValue;
struct IntValueBuilder;
struct IntValueT;

struct FloatValue;
struct FloatValueBuilder;
struct FloatValueT;

struct StringValue;
struct StringValueBuilder;
struct StringValueT;

struct IntConstraint;
struct IntConstraintBuilder;
struct IntConstraintT;

struct FloatConstraint;
struct FloatConstraintBuilder;
struct FloatConstraintT;

struct StringConstraint;
struct StringConstraintBuilder;
struct StringConstraintT;

struct Knob;
struct KnobBuilder;
struct KnobT;

bool operator==(const IntValueT &lhs, const IntValueT &rhs);
bool operator!=(const IntValueT &lhs, const IntValueT &rhs);
bool operator==(const FloatValueT &lhs, const FloatValueT &rhs);
bool operator!=(const FloatValueT &lhs, const FloatValueT &rhs);
bool operator==(const StringValueT &lhs, const StringValueT &rhs);
bool operator!=(const StringValueT &lhs, const StringValueT &rhs);
bool operator==(const IntConstraintT &lhs, const IntConstraintT &rhs);
bool operator!=(const IntConstraintT &lhs, const IntConstraintT &rhs);
bool operator==(const FloatConstraintT &lhs, const FloatConstraintT &rhs);
bool operator!=(const FloatConstraintT &lhs, const FloatConstraintT &rhs);
bool operator==(const StringConstraintT &lhs, const StringConstraintT &rhs);
bool operator!=(const StringConstraintT &lhs, const StringConstraintT &rhs);
bool operator==(const KnobT &lhs, const KnobT &rhs);
bool operator!=(const KnobT &lhs, const KnobT &rhs);

enum class KnobValue : uint8_t {
  NONE = 0,
  IntValue = 1,
  FloatValue = 2,
  StringValue = 3,
  MIN = NONE,
  MAX = StringValue
};

inline const KnobValue (&EnumValuesKnobValue())[4] {
  static const KnobValue values[] = {
    KnobValue::NONE,
    KnobValue::IntValue,
    KnobValue::FloatValue,
    KnobValue::StringValue
  };
  return values;
}

inline const char * const *EnumNamesKnobValue() {
  static const char * const names[5] = {
    "NONE",
    "IntValue",
    "FloatValue",
    "StringValue",
    nullptr
  };
  return names;
}

inline const char *EnumNameKnobValue(KnobValue e) {
  if (::flatbuffers::IsOutRange(e, KnobValue::NONE, KnobValue::StringValue)) return "";
  const size_t index = static_cast<size_t>(e);
  return EnumNamesKnobValue()[index];
}

template<typename T> struct KnobValueTraits {
  static const KnobValue enum_value = KnobValue::NONE;
};

template<> struct KnobValueTraits<hipdnn_data_sdk::data_objects::IntValue> {
  static const KnobValue enum_value = KnobValue::IntValue;
};

template<> struct KnobValueTraits<hipdnn_data_sdk::data_objects::FloatValue> {
  static const KnobValue enum_value = KnobValue::FloatValue;
};

template<> struct KnobValueTraits<hipdnn_data_sdk::data_objects::StringValue> {
  static const KnobValue enum_value = KnobValue::StringValue;
};

template<typename T> struct KnobValueUnionTraits {
  static const KnobValue enum_value = KnobValue::NONE;
};

template<> struct KnobValueUnionTraits<hipdnn_data_sdk::data_objects::IntValueT> {
  static const KnobValue enum_value = KnobValue::IntValue;
};

template<> struct KnobValueUnionTraits<hipdnn_data_sdk::data_objects::FloatValueT> {
  static const KnobValue enum_value = KnobValue::FloatValue;
};

template<> struct KnobValueUnionTraits<hipdnn_data_sdk::data_objects::StringValueT> {
  static const KnobValue enum_value = KnobValue::StringValue;
};

struct KnobValueUnion {
  KnobValue type;
  void *value;

  KnobValueUnion() : type(KnobValue::NONE), value(nullptr) {}
  KnobValueUnion(KnobValueUnion&& u) FLATBUFFERS_NOEXCEPT :
    type(KnobValue::NONE), value(nullptr)
    { std::swap(type, u.type); std::swap(value, u.value); }
  KnobValueUnion(const KnobValueUnion &);
  KnobValueUnion &operator=(const KnobValueUnion &u)
    { KnobValueUnion t(u); std::swap(type, t.type); std::swap(value, t.value); return *this; }
  KnobValueUnion &operator=(KnobValueUnion &&u) FLATBUFFERS_NOEXCEPT
    { std::swap(type, u.type); std::swap(value, u.value); return *this; }
  ~KnobValueUnion() { Reset(); }

  void Reset();

  template <typename T>
  void Set(T&& val) {
    typedef typename std::remove_reference<T>::type RT;
    Reset();
    type = KnobValueUnionTraits<RT>::enum_value;
    if (type != KnobValue::NONE) {
      value = new RT(std::forward<T>(val));
    }
  }

  static void *UnPack(const void *obj, KnobValue type, const ::flatbuffers::resolver_function_t *resolver);
  ::flatbuffers::Offset<void> Pack(::flatbuffers::FlatBufferBuilder &_fbb, const ::flatbuffers::rehasher_function_t *_rehasher = nullptr) const;

  hipdnn_data_sdk::data_objects::IntValueT *AsIntValue() {
    return type == KnobValue::IntValue ?
      reinterpret_cast<hipdnn_data_sdk::data_objects::IntValueT *>(value) : nullptr;
  }
  const hipdnn_data_sdk::data_objects::IntValueT *AsIntValue() const {
    return type == KnobValue::IntValue ?
      reinterpret_cast<const hipdnn_data_sdk::data_objects::IntValueT *>(value) : nullptr;
  }
  hipdnn_data_sdk::data_objects::FloatValueT *AsFloatValue() {
    return type == KnobValue::FloatValue ?
      reinterpret_cast<hipdnn_data_sdk::data_objects::FloatValueT *>(value) : nullptr;
  }
  const hipdnn_data_sdk::data_objects::FloatValueT *AsFloatValue() const {
    return type == KnobValue::FloatValue ?
      reinterpret_cast<const hipdnn_data_sdk::data_objects::FloatValueT *>(value) : nullptr;
  }
  hipdnn_data_sdk::data_objects::StringValueT *AsStringValue() {
    return type == KnobValue::StringValue ?
      reinterpret_cast<hipdnn_data_sdk::data_objects::StringValueT *>(value) : nullptr;
  }
  const hipdnn_data_sdk::data_objects::StringValueT *AsStringValue() const {
    return type == KnobValue::StringValue ?
      reinterpret_cast<const hipdnn_data_sdk::data_objects::StringValueT *>(value) : nullptr;
  }
};


inline bool operator==(const KnobValueUnion &lhs, const KnobValueUnion &rhs) {
  if (lhs.type != rhs.type) return false;
  switch (lhs.type) {
    case KnobValue::NONE: {
      return true;
    }
    case KnobValue::IntValue: {
      return *(reinterpret_cast<const hipdnn_data_sdk::data_objects::IntValueT *>(lhs.value)) ==
             *(reinterpret_cast<const hipdnn_data_sdk::data_objects::IntValueT *>(rhs.value));
    }
    case KnobValue::FloatValue: {
      return *(reinterpret_cast<const hipdnn_data_sdk::data_objects::FloatValueT *>(lhs.value)) ==
             *(reinterpret_cast<const hipdnn_data_sdk::data_objects::FloatValueT *>(rhs.value));
    }
    case KnobValue::StringValue: {
      return *(reinterpret_cast<const hipdnn_data_sdk::data_objects::StringValueT *>(lhs.value)) ==
             *(reinterpret_cast<const hipdnn_data_sdk::data_objects::StringValueT *>(rhs.value));
    }
    default: {
      return false;
    }
  }
}

inline bool operator!=(const KnobValueUnion &lhs, const KnobValueUnion &rhs) {
    return !(lhs == rhs);
}

bool VerifyKnobValue(::flatbuffers::Verifier &verifier, const void *obj, KnobValue type);
bool VerifyKnobValueVector(::flatbuffers::Verifier &verifier, const ::flatbuffers::Vector<::flatbuffers::Offset<void>> *values, const ::flatbuffers::Vector<KnobValue> *types);

enum class KnobConstraint : uint8_t {
  NONE = 0,
  IntConstraint = 1,
  FloatConstraint = 2,
  StringConstraint = 3,
  MIN = NONE,
  MAX = StringConstraint
};

inline const KnobConstraint (&EnumValuesKnobConstraint())[4] {
  static const KnobConstraint values[] = {
    KnobConstraint::NONE,
    KnobConstraint::IntConstraint,
    KnobConstraint::FloatConstraint,
    KnobConstraint::StringConstraint
  };
  return values;
}

inline const char * const *EnumNamesKnobConstraint() {
  static const char * const names[5] = {
    "NONE",
    "IntConstraint",
    "FloatConstraint",
    "StringConstraint",
    nullptr
  };
  return names;
}

inline const char *EnumNameKnobConstraint(KnobConstraint e) {
  if (::flatbuffers::IsOutRange(e, KnobConstraint::NONE, KnobConstraint::StringConstraint)) return "";
  const size_t index = static_cast<size_t>(e);
  return EnumNamesKnobConstraint()[index];
}

template<typename T> struct KnobConstraintTraits {
  static const KnobConstraint enum_value = KnobConstraint::NONE;
};

template<> struct KnobConstraintTraits<hipdnn_data_sdk::data_objects::IntConstraint> {
  static const KnobConstraint enum_value = KnobConstraint::IntConstraint;
};

template<> struct KnobConstraintTraits<hipdnn_data_sdk::data_objects::FloatConstraint> {
  static const KnobConstraint enum_value = KnobConstraint::FloatConstraint;
};

template<> struct KnobConstraintTraits<hipdnn_data_sdk::data_objects::StringConstraint> {
  static const KnobConstraint enum_value = KnobConstraint::StringConstraint;
};

template<typename T> struct KnobConstraintUnionTraits {
  static const KnobConstraint enum_value = KnobConstraint::NONE;
};

template<> struct KnobConstraintUnionTraits<hipdnn_data_sdk::data_objects::IntConstraintT> {
  static const KnobConstraint enum_value = KnobConstraint::IntConstraint;
};

template<> struct KnobConstraintUnionTraits<hipdnn_data_sdk::data_objects::FloatConstraintT> {
  static const KnobConstraint enum_value = KnobConstraint::FloatConstraint;
};

template<> struct KnobConstraintUnionTraits<hipdnn_data_sdk::data_objects::StringConstraintT> {
  static const KnobConstraint enum_value = KnobConstraint::StringConstraint;
};

struct KnobConstraintUnion {
  KnobConstraint type;
  void *value;

  KnobConstraintUnion() : type(KnobConstraint::NONE), value(nullptr) {}
  KnobConstraintUnion(KnobConstraintUnion&& u) FLATBUFFERS_NOEXCEPT :
    type(KnobConstraint::NONE), value(nullptr)
    { std::swap(type, u.type); std::swap(value, u.value); }
  KnobConstraintUnion(const KnobConstraintUnion &);
  KnobConstraintUnion &operator=(const KnobConstraintUnion &u)
    { KnobConstraintUnion t(u); std::swap(type, t.type); std::swap(value, t.value); return *this; }
  KnobConstraintUnion &operator=(KnobConstraintUnion &&u) FLATBUFFERS_NOEXCEPT
    { std::swap(type, u.type); std::swap(value, u.value); return *this; }
  ~KnobConstraintUnion() { Reset(); }

  void Reset();

  template <typename T>
  void Set(T&& val) {
    typedef typename std::remove_reference<T>::type RT;
    Reset();
    type = KnobConstraintUnionTraits<RT>::enum_value;
    if (type != KnobConstraint::NONE) {
      value = new RT(std::forward<T>(val));
    }
  }

  static void *UnPack(const void *obj, KnobConstraint type, const ::flatbuffers::resolver_function_t *resolver);
  ::flatbuffers::Offset<void> Pack(::flatbuffers::FlatBufferBuilder &_fbb, const ::flatbuffers::rehasher_function_t *_rehasher = nullptr) const;

  hipdnn_data_sdk::data_objects::IntConstraintT *AsIntConstraint() {
    return type == KnobConstraint::IntConstraint ?
      reinterpret_cast<hipdnn_data_sdk::data_objects::IntConstraintT *>(value) : nullptr;
  }
  const hipdnn_data_sdk::data_objects::IntConstraintT *AsIntConstraint() const {
    return type == KnobConstraint::IntConstraint ?
      reinterpret_cast<const hipdnn_data_sdk::data_objects::IntConstraintT *>(value) : nullptr;
  }
  hipdnn_data_sdk::data_objects::FloatConstraintT *AsFloatConstraint() {
    return type == KnobConstraint::FloatConstraint ?
      reinterpret_cast<hipdnn_data_sdk::data_objects::FloatConstraintT *>(value) : nullptr;
  }
  const hipdnn_data_sdk::data_objects::FloatConstraintT *AsFloatConstraint() const {
    return type == KnobConstraint::FloatConstraint ?
      reinterpret_cast<const hipdnn_data_sdk::data_objects::FloatConstraintT *>(value) : nullptr;
  }
  hipdnn_data_sdk::data_objects::StringConstraintT *AsStringConstraint() {
    return type == KnobConstraint::StringConstraint ?
      reinterpret_cast<hipdnn_data_sdk::data_objects::StringConstraintT *>(value) : nullptr;
  }
  const hipdnn_data_sdk::data_objects::StringConstraintT *AsStringConstraint() const {
    return type == KnobConstraint::StringConstraint ?
      reinterpret_cast<const hipdnn_data_sdk::data_objects::StringConstraintT *>(value) : nullptr;
  }
};


inline bool operator==(const KnobConstraintUnion &lhs, const KnobConstraintUnion &rhs) {
  if (lhs.type != rhs.type) return false;
  switch (lhs.type) {
    case KnobConstraint::NONE: {
      return true;
    }
    case KnobConstraint::IntConstraint: {
      return *(reinterpret_cast<const hipdnn_data_sdk::data_objects::IntConstraintT *>(lhs.value)) ==
             *(reinterpret_cast<const hipdnn_data_sdk::data_objects::IntConstraintT *>(rhs.value));
    }
    case KnobConstraint::FloatConstraint: {
      return *(reinterpret_cast<const hipdnn_data_sdk::data_objects::FloatConstraintT *>(lhs.value)) ==
             *(reinterpret_cast<const hipdnn_data_sdk::data_objects::FloatConstraintT *>(rhs.value));
    }
    case KnobConstraint::StringConstraint: {
      return *(reinterpret_cast<const hipdnn_data_sdk::data_objects::StringConstraintT *>(lhs.value)) ==
             *(reinterpret_cast<const hipdnn_data_sdk::data_objects::StringConstraintT *>(rhs.value));
    }
    default: {
      return false;
    }
  }
}

inline bool operator!=(const KnobConstraintUnion &lhs, const KnobConstraintUnion &rhs) {
    return !(lhs == rhs);
}

bool VerifyKnobConstraint(::flatbuffers::Verifier &verifier, const void *obj, KnobConstraint type);
bool VerifyKnobConstraintVector(::flatbuffers::Verifier &verifier, const ::flatbuffers::Vector<::flatbuffers::Offset<void>> *values, const ::flatbuffers::Vector<KnobConstraint> *types);

struct IntValueT : public ::flatbuffers::NativeTable {
  typedef IntValue TableType;
  int64_t value = 0;
};

struct IntValue FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
  typedef IntValueT NativeTableType;
  typedef IntValueBuilder Builder;
  enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
    VT_VALUE = 4
  };
  int64_t value() const {
    return GetField<int64_t>(VT_VALUE, 0);
  }
  bool mutate_value(int64_t _value = 0) {
    return SetField<int64_t>(VT_VALUE, _value, 0);
  }
  bool Verify(::flatbuffers::Verifier &verifier) const {
    return VerifyTableStart(verifier) &&
           VerifyField<int64_t>(verifier, VT_VALUE, 8) &&
           verifier.EndTable();
  }
  IntValueT *UnPack(const ::flatbuffers::resolver_function_t *_resolver = nullptr) const;
  void UnPackTo(IntValueT *_o, const ::flatbuffers::resolver_function_t *_resolver = nullptr) const;
  static ::flatbuffers::Offset<IntValue> Pack(::flatbuffers::FlatBufferBuilder &_fbb, const IntValueT* _o, const ::flatbuffers::rehasher_function_t *_rehasher = nullptr);
};

struct IntValueBuilder {
  typedef IntValue Table;
  ::flatbuffers::FlatBufferBuilder &fbb_;
  ::flatbuffers::uoffset_t start_;
  void add_value(int64_t value) {
    fbb_.AddElement<int64_t>(IntValue::VT_VALUE, value, 0);
  }
  explicit IntValueBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
        : fbb_(_fbb) {
    start_ = fbb_.StartTable();
  }
  ::flatbuffers::Offset<IntValue> Finish() {
    const auto end = fbb_.EndTable(start_);
    auto o = ::flatbuffers::Offset<IntValue>(end);
    return o;
  }
};

inline ::flatbuffers::Offset<IntValue> CreateIntValue(
    ::flatbuffers::FlatBufferBuilder &_fbb,
    int64_t value = 0) {
  IntValueBuilder builder_(_fbb);
  builder_.add_value(value);
  return builder_.Finish();
}

::flatbuffers::Offset<IntValue> CreateIntValue(::flatbuffers::FlatBufferBuilder &_fbb, const IntValueT *_o, const ::flatbuffers::rehasher_function_t *_rehasher = nullptr);

struct FloatValueT : public ::flatbuffers::NativeTable {
  typedef FloatValue TableType;
  double value = 0.0;
};

struct FloatValue FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
  typedef FloatValueT NativeTableType;
  typedef FloatValueBuilder Builder;
  enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
    VT_VALUE = 4
  };
  double value() const {
    return GetField<double>(VT_VALUE, 0.0);
  }
  bool mutate_value(double _value = 0.0) {
    return SetField<double>(VT_VALUE, _value, 0.0);
  }
  bool Verify(::flatbuffers::Verifier &verifier) const {
    return VerifyTableStart(verifier) &&
           VerifyField<double>(verifier, VT_VALUE, 8) &&
           verifier.EndTable();
  }
  FloatValueT *UnPack(const ::flatbuffers::resolver_function_t *_resolver = nullptr) const;
  void UnPackTo(FloatValueT *_o, const ::flatbuffers::resolver_function_t *_resolver = nullptr) const;
  static ::flatbuffers::Offset<FloatValue> Pack(::flatbuffers::FlatBufferBuilder &_fbb, const FloatValueT* _o, const ::flatbuffers::rehasher_function_t *_rehasher = nullptr);
};

struct FloatValueBuilder {
  typedef FloatValue Table;
  ::flatbuffers::FlatBufferBuilder &fbb_;
  ::flatbuffers::uoffset_t start_;
  void add_value(double value) {
    fbb_.AddElement<double>(FloatValue::VT_VALUE, value, 0.0);
  }
  explicit FloatValueBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
        : fbb_(_fbb) {
    start_ = fbb_.StartTable();
  }
  ::flatbuffers::Offset<FloatValue> Finish() {
    const auto end = fbb_.EndTable(start_);
    auto o = ::flatbuffers::Offset<FloatValue>(end);
    return o;
  }
};

inline ::flatbuffers::Offset<FloatValue> CreateFloatValue(
    ::flatbuffers::FlatBufferBuilder &_fbb,
    double value = 0.0) {
  FloatValueBuilder builder_(_fbb);
  builder_.add_value(value);
  return builder_.Finish();
}

::flatbuffers::Offset<FloatValue> CreateFloatValue(::flatbuffers::FlatBufferBuilder &_fbb, const FloatValueT *_o, const ::flatbuffers::rehasher_function_t *_rehasher = nullptr);

struct StringValueT : public ::flatbuffers::NativeTable {
  typedef StringValue TableType;
  std::string value{};
};

struct StringValue FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
  typedef StringValueT NativeTableType;
  typedef StringValueBuilder Builder;
  enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
    VT_VALUE = 4
  };
  const ::flatbuffers::String *value() const {
    return GetPointer<const ::flatbuffers::String *>(VT_VALUE);
  }
  ::flatbuffers::String *mutable_value() {
    return GetPointer<::flatbuffers::String *>(VT_VALUE);
  }
  bool Verify(::flatbuffers::Verifier &verifier) const {
    return VerifyTableStart(verifier) &&
           VerifyOffset(verifier, VT_VALUE) &&
           verifier.VerifyString(value()) &&
           verifier.EndTable();
  }
  StringValueT *UnPack(const ::flatbuffers::resolver_function_t *_resolver = nullptr) const;
  void UnPackTo(StringValueT *_o, const ::flatbuffers::resolver_function_t *_resolver = nullptr) const;
  static ::flatbuffers::Offset<StringValue> Pack(::flatbuffers::FlatBufferBuilder &_fbb, const StringValueT* _o, const ::flatbuffers::rehasher_function_t *_rehasher = nullptr);
};

struct StringValueBuilder {
  typedef StringValue Table;
  ::flatbuffers::FlatBufferBuilder &fbb_;
  ::flatbuffers::uoffset_t start_;
  void add_value(::flatbuffers::Offset<::flatbuffers::String> value) {
    fbb_.AddOffset(StringValue::VT_VALUE, value);
  }
  explicit StringValueBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
        : fbb_(_fbb) {
    start_ = fbb_.StartTable();
  }
  ::flatbuffers::Offset<StringValue> Finish() {
    const auto end = fbb_.EndTable(start_);
    auto o = ::flatbuffers::Offset<StringValue>(end);
    return o;
  }
};

inline ::flatbuffers::Offset<StringValue> CreateStringValue(
    ::flatbuffers::FlatBufferBuilder &_fbb,
    ::flatbuffers::Offset<::flatbuffers::String> value = 0) {
  StringValueBuilder builder_(_fbb);
  builder_.add_value(value);
  return builder_.Finish();
}

inline ::flatbuffers::Offset<StringValue> CreateStringValueDirect(
    ::flatbuffers::FlatBufferBuilder &_fbb,
    const char *value = nullptr) {
  auto value__ = value ? _fbb.CreateString(value) : 0;
  return hipdnn_data_sdk::data_objects::CreateStringValue(
      _fbb,
      value__);
}

::flatbuffers::Offset<StringValue> CreateStringValue(::flatbuffers::FlatBufferBuilder &_fbb, const StringValueT *_o, const ::flatbuffers::rehasher_function_t *_rehasher = nullptr);

struct IntConstraintT : public ::flatbuffers::NativeTable {
  typedef IntConstraint TableType;
  int64_t min_value = 0;
  int64_t max_value = 0;
  int64_t step = 1LL;
  std::vector<int64_t> valid_values{};
};

struct IntConstraint FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
  typedef IntConstraintT NativeTableType;
  typedef IntConstraintBuilder Builder;
  enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
    VT_MIN_VALUE = 4,
    VT_MAX_VALUE = 6,
    VT_STEP = 8,
    VT_VALID_VALUES = 10
  };
  int64_t min_value() const {
    return GetField<int64_t>(VT_MIN_VALUE, 0);
  }
  bool mutate_min_value(int64_t _min_value = 0) {
    return SetField<int64_t>(VT_MIN_VALUE, _min_value, 0);
  }
  int64_t max_value() const {
    return GetField<int64_t>(VT_MAX_VALUE, 0);
  }
  bool mutate_max_value(int64_t _max_value = 0) {
    return SetField<int64_t>(VT_MAX_VALUE, _max_value, 0);
  }
  int64_t step() const {
    return GetField<int64_t>(VT_STEP, 1LL);
  }
  bool mutate_step(int64_t _step = 1LL) {
    return SetField<int64_t>(VT_STEP, _step, 1LL);
  }
  const ::flatbuffers::Vector<int64_t> *valid_values() const {
    return GetPointer<const ::flatbuffers::Vector<int64_t> *>(VT_VALID_VALUES);
  }
  ::flatbuffers::Vector<int64_t> *mutable_valid_values() {
    return GetPointer<::flatbuffers::Vector<int64_t> *>(VT_VALID_VALUES);
  }
  bool Verify(::flatbuffers::Verifier &verifier) const {
    return VerifyTableStart(verifier) &&
           VerifyField<int64_t>(verifier, VT_MIN_VALUE, 8) &&
           VerifyField<int64_t>(verifier, VT_MAX_VALUE, 8) &&
           VerifyField<int64_t>(verifier, VT_STEP, 8) &&
           VerifyOffset(verifier, VT_VALID_VALUES) &&
           verifier.VerifyVector(valid_values()) &&
           verifier.EndTable();
  }
  IntConstraintT *UnPack(const ::flatbuffers::resolver_function_t *_resolver = nullptr) const;
  void UnPackTo(IntConstraintT *_o, const ::flatbuffers::resolver_function_t *_resolver = nullptr) const;
  static ::flatbuffers::Offset<IntConstraint> Pack(::flatbuffers::FlatBufferBuilder &_fbb, const IntConstraintT* _o, const ::flatbuffers::rehasher_function_t *_rehasher = nullptr);
};

struct IntConstraintBuilder {
  typedef IntConstraint Table;
  ::flatbuffers::FlatBufferBuilder &fbb_;
  ::flatbuffers::uoffset_t start_;
  void add_min_value(int64_t min_value) {
    fbb_.AddElement<int64_t>(IntConstraint::VT_MIN_VALUE, min_value, 0);
  }
  void add_max_value(int64_t max_value) {
    fbb_.AddElement<int64_t>(IntConstraint::VT_MAX_VALUE, max_value, 0);
  }
  void add_step(int64_t step) {
    fbb_.AddElement<int64_t>(IntConstraint::VT_STEP, step, 1LL);
  }
  void add_valid_values(::flatbuffers::Offset<::flatbuffers::Vector<int64_t>> valid_values) {
    fbb_.AddOffset(IntConstraint::VT_VALID_VALUES, valid_values);
  }
  explicit IntConstraintBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
        : fbb_(_fbb) {
    start_ = fbb_.StartTable();
  }
  ::flatbuffers::Offset<IntConstraint> Finish() {
    const auto end = fbb_.EndTable(start_);
    auto o = ::flatbuffers::Offset<IntConstraint>(end);
    return o;
  }
};

inline ::flatbuffers::Offset<IntConstraint> CreateIntConstraint(
    ::flatbuffers::FlatBufferBuilder &_fbb,
    int64_t min_value = 0,
    int64_t max_value = 0,
    int64_t step = 1LL,
    ::flatbuffers::Offset<::flatbuffers::Vector<int64_t>> valid_values = 0) {
  IntConstraintBuilder builder_(_fbb);
  builder_.add_step(step);
  builder_.add_max_value(max_value);
  builder_.add_min_value(min_value);
  builder_.add_valid_values(valid_values);
  return builder_.Finish();
}

inline ::flatbuffers::Offset<IntConstraint> CreateIntConstraintDirect(
    ::flatbuffers::FlatBufferBuilder &_fbb,
    int64_t min_value = 0,
    int64_t max_value = 0,
    int64_t step = 1LL,
    const std::vector<int64_t> *valid_values = nullptr) {
  auto valid_values__ = valid_values ? _fbb.CreateVector<int64_t>(*valid_values) : 0;
  return hipdnn_data_sdk::data_objects::CreateIntConstraint(
      _fbb,
      min_value,
      max_value,
      step,
      valid_values__);
}

::flatbuffers::Offset<IntConstraint> CreateIntConstraint(::flatbuffers::FlatBufferBuilder &_fbb, const IntConstraintT *_o, const ::flatbuffers::rehasher_function_t *_rehasher = nullptr);

struct FloatConstraintT : public ::flatbuffers::NativeTable {
  typedef FloatConstraint TableType;
  double min_value = 0.0;
  double max_value = 0.0;
  std::vector<double> valid_values{};
};

struct FloatConstraint FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
  typedef FloatConstraintT NativeTableType;
  typedef FloatConstraintBuilder Builder;
  enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
    VT_MIN_VALUE = 4,
    VT_MAX_VALUE = 6,
    VT_VALID_VALUES = 8
  };
  double min_value() const {
    return GetField<double>(VT_MIN_VALUE, 0.0);
  }
  bool mutate_min_value(double _min_value = 0.0) {
    return SetField<double>(VT_MIN_VALUE, _min_value, 0.0);
  }
  double max_value() const {
    return GetField<double>(VT_MAX_VALUE, 0.0);
  }
  bool mutate_max_value(double _max_value = 0.0) {
    return SetField<double>(VT_MAX_VALUE, _max_value, 0.0);
  }
  const ::flatbuffers::Vector<double> *valid_values() const {
    return GetPointer<const ::flatbuffers::Vector<double> *>(VT_VALID_VALUES);
  }
  ::flatbuffers::Vector<double> *mutable_valid_values() {
    return GetPointer<::flatbuffers::Vector<double> *>(VT_VALID_VALUES);
  }
  bool Verify(::flatbuffers::Verifier &verifier) const {
    return VerifyTableStart(verifier) &&
           VerifyField<double>(verifier, VT_MIN_VALUE, 8) &&
           VerifyField<double>(verifier, VT_MAX_VALUE, 8) &&
           VerifyOffset(verifier, VT_VALID_VALUES) &&
           verifier.VerifyVector(valid_values()) &&
           verifier.EndTable();
  }
  FloatConstraintT *UnPack(const ::flatbuffers::resolver_function_t *_resolver = nullptr) const;
  void UnPackTo(FloatConstraintT *_o, const ::flatbuffers::resolver_function_t *_resolver = nullptr) const;
  static ::flatbuffers::Offset<FloatConstraint> Pack(::flatbuffers::FlatBufferBuilder &_fbb, const FloatConstraintT* _o, const ::flatbuffers::rehasher_function_t *_rehasher = nullptr);
};

struct FloatConstraintBuilder {
  typedef FloatConstraint Table;
  ::flatbuffers::FlatBufferBuilder &fbb_;
  ::flatbuffers::uoffset_t start_;
  void add_min_value(double min_value) {
    fbb_.AddElement<double>(FloatConstraint::VT_MIN_VALUE, min_value, 0.0);
  }
  void add_max_value(double max_value) {
    fbb_.AddElement<double>(FloatConstraint::VT_MAX_VALUE, max_value, 0.0);
  }
  void add_valid_values(::flatbuffers::Offset<::flatbuffers::Vector<double>> valid_values) {
    fbb_.AddOffset(FloatConstraint::VT_VALID_VALUES, valid_values);
  }
  explicit FloatConstraintBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
        : fbb_(_fbb) {
    start_ = fbb_.StartTable();
  }
  ::flatbuffers::Offset<FloatConstraint> Finish() {
    const auto end = fbb_.EndTable(start_);
    auto o = ::flatbuffers::Offset<FloatConstraint>(end);
    return o;
  }
};

inline ::flatbuffers::Offset<FloatConstraint> CreateFloatConstraint(
    ::flatbuffers::FlatBufferBuilder &_fbb,
    double min_value = 0.0,
    double max_value = 0.0,
    ::flatbuffers::Offset<::flatbuffers::Vector<double>> valid_values = 0) {
  FloatConstraintBuilder builder_(_fbb);
  builder_.add_max_value(max_value);
  builder_.add_min_value(min_value);
  builder_.add_valid_values(valid_values);
  return builder_.Finish();
}

inline ::flatbuffers::Offset<FloatConstraint> CreateFloatConstraintDirect(
    ::flatbuffers::FlatBufferBuilder &_fbb,
    double min_value = 0.0,
    double max_value = 0.0,
    const std::vector<double> *valid_values = nullptr) {
  auto valid_values__ = valid_values ? _fbb.CreateVector<double>(*valid_values) : 0;
  return hipdnn_data_sdk::data_objects::CreateFloatConstraint(
      _fbb,
      min_value,
      max_value,
      valid_values__);
}

::flatbuffers::Offset<FloatConstraint> CreateFloatConstraint(::flatbuffers::FlatBufferBuilder &_fbb, const FloatConstraintT *_o, const ::flatbuffers::rehasher_function_t *_rehasher = nullptr);

struct StringConstraintT : public ::flatbuffers::NativeTable {
  typedef StringConstraint TableType;
  int32_t max_length = 0;
  std::vector<std::string> valid_values{};
};

struct StringConstraint FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
  typedef StringConstraintT NativeTableType;
  typedef StringConstraintBuilder Builder;
  enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
    VT_MAX_LENGTH = 4,
    VT_VALID_VALUES = 6
  };
  int32_t max_length() const {
    return GetField<int32_t>(VT_MAX_LENGTH, 0);
  }
  bool mutate_max_length(int32_t _max_length = 0) {
    return SetField<int32_t>(VT_MAX_LENGTH, _max_length, 0);
  }
  const ::flatbuffers::Vector<::flatbuffers::Offset<::flatbuffers::String>> *valid_values() const {
    return GetPointer<const ::flatbuffers::Vector<::flatbuffers::Offset<::flatbuffers::String>> *>(VT_VALID_VALUES);
  }
  ::flatbuffers::Vector<::flatbuffers::Offset<::flatbuffers::String>> *mutable_valid_values() {
    return GetPointer<::flatbuffers::Vector<::flatbuffers::Offset<::flatbuffers::String>> *>(VT_VALID_VALUES);
  }
  bool Verify(::flatbuffers::Verifier &verifier) const {
    return VerifyTableStart(verifier) &&
           VerifyField<int32_t>(verifier, VT_MAX_LENGTH, 4) &&
           VerifyOffset(verifier, VT_VALID_VALUES) &&
           verifier.VerifyVector(valid_values()) &&
           verifier.VerifyVectorOfStrings(valid_values()) &&
           verifier.EndTable();
  }
  StringConstraintT *UnPack(const ::flatbuffers::resolver_function_t *_resolver = nullptr) const;
  void UnPackTo(StringConstraintT *_o, const ::flatbuffers::resolver_function_t *_resolver = nullptr) const;
  static ::flatbuffers::Offset<StringConstraint> Pack(::flatbuffers::FlatBufferBuilder &_fbb, const StringConstraintT* _o, const ::flatbuffers::rehasher_function_t *_rehasher = nullptr);
};

struct StringConstraintBuilder {
  typedef StringConstraint Table;
  ::flatbuffers::FlatBufferBuilder &fbb_;
  ::flatbuffers::uoffset_t start_;
  void add_max_length(int32_t max_length) {
    fbb_.AddElement<int32_t>(StringConstraint::VT_MAX_LENGTH, max_length, 0);
  }
  void add_valid_values(::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<::flatbuffers::String>>> valid_values) {
    fbb_.AddOffset(StringConstraint::VT_VALID_VALUES, valid_values);
  }
  explicit StringConstraintBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
        : fbb_(_fbb) {
    start_ = fbb_.StartTable();
  }
  ::flatbuffers::Offset<StringConstraint> Finish() {
    const auto end = fbb_.EndTable(start_);
    auto o = ::flatbuffers::Offset<StringConstraint>(end);
    return o;
  }
};

inline ::flatbuffers::Offset<StringConstraint> CreateStringConstraint(
    ::flatbuffers::FlatBufferBuilder &_fbb,
    int32_t max_length = 0,
    ::flatbuffers::Offset<::flatbuffers::Vector<::flatbuffers::Offset<::flatbuffers::String>>> valid_values = 0) {
  StringConstraintBuilder builder_(_fbb);
  builder_.add_valid_values(valid_values);
  builder_.add_max_length(max_length);
  return builder_.Finish();
}

inline ::flatbuffers::Offset<StringConstraint> CreateStringConstraintDirect(
    ::flatbuffers::FlatBufferBuilder &_fbb,
    int32_t max_length = 0,
    const std::vector<::flatbuffers::Offset<::flatbuffers::String>> *valid_values = nullptr) {
  auto valid_values__ = valid_values ? _fbb.CreateVector<::flatbuffers::Offset<::flatbuffers::String>>(*valid_values) : 0;
  return hipdnn_data_sdk::data_objects::CreateStringConstraint(
      _fbb,
      max_length,
      valid_values__);
}

::flatbuffers::Offset<StringConstraint> CreateStringConstraint(::flatbuffers::FlatBufferBuilder &_fbb, const StringConstraintT *_o, const ::flatbuffers::rehasher_function_t *_rehasher = nullptr);

struct KnobT : public ::flatbuffers::NativeTable {
  typedef Knob TableType;
  int64_t knob_id = 0;
  std::string knob_id_str{};
  std::string description{};
  hipdnn_data_sdk::data_objects::KnobValueUnion value_type{};
  hipdnn_data_sdk::data_objects::KnobValueUnion default_value{};
  hipdnn_data_sdk::data_objects::KnobConstraintUnion constraints{};
  bool deprecated = false;
};

struct Knob FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
  typedef KnobT NativeTableType;
  typedef KnobBuilder Builder;
  enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
    VT_KNOB_ID = 4,
    VT_KNOB_ID_STR = 6,
    VT_DESCRIPTION = 8,
    VT_VALUE_TYPE_TYPE = 10,
    VT_VALUE_TYPE = 12,
    VT_DEFAULT_VALUE_TYPE = 14,
    VT_DEFAULT_VALUE = 16,
    VT_CONSTRAINTS_TYPE = 18,
    VT_CONSTRAINTS = 20,
    VT_DEPRECATED = 22
  };
  int64_t knob_id() const {
    return GetField<int64_t>(VT_KNOB_ID, 0);
  }
  bool mutate_knob_id(int64_t _knob_id = 0) {
    return SetField<int64_t>(VT_KNOB_ID, _knob_id, 0);
  }
  const ::flatbuffers::String *knob_id_str() const {
    return GetPointer<const ::flatbuffers::String *>(VT_KNOB_ID_STR);
  }
  ::flatbuffers::String *mutable_knob_id_str() {
    return GetPointer<::flatbuffers::String *>(VT_KNOB_ID_STR);
  }
  const ::flatbuffers::String *description() const {
    return GetPointer<const ::flatbuffers::String *>(VT_DESCRIPTION);
  }
  ::flatbuffers::String *mutable_description() {
    return GetPointer<::flatbuffers::String *>(VT_DESCRIPTION);
  }
  hipdnn_data_sdk::data_objects::KnobValue value_type_type() const {
    return static_cast<hipdnn_data_sdk::data_objects::KnobValue>(GetField<uint8_t>(VT_VALUE_TYPE_TYPE, 0));
  }
  const void *value_type() const {
    return GetPointer<const void *>(VT_VALUE_TYPE);
  }
  template<typename T> const T *value_type_as() const;
  const hipdnn_data_sdk::data_objects::IntValue *value_type_as_IntValue() const {
    return value_type_type() == hipdnn_data_sdk::data_objects::KnobValue::IntValue ? static_cast<const hipdnn_data_sdk::data_objects::IntValue *>(value_type()) : nullptr;
  }
  const hipdnn_data_sdk::data_objects::FloatValue *value_type_as_FloatValue() const {
    return value_type_type() == hipdnn_data_sdk::data_objects::KnobValue::FloatValue ? static_cast<const hipdnn_data_sdk::data_objects::FloatValue *>(value_type()) : nullptr;
  }
  const hipdnn_data_sdk::data_objects::StringValue *value_type_as_StringValue() const {
    return value_type_type() == hipdnn_data_sdk::data_objects::KnobValue::StringValue ? static_cast<const hipdnn_data_sdk::data_objects::StringValue *>(value_type()) : nullptr;
  }
  void *mutable_value_type() {
    return GetPointer<void *>(VT_VALUE_TYPE);
  }
  hipdnn_data_sdk::data_objects::KnobValue default_value_type() const {
    return static_cast<hipdnn_data_sdk::data_objects::KnobValue>(GetField<uint8_t>(VT_DEFAULT_VALUE_TYPE, 0));
  }
  const void *default_value() const {
    return GetPointer<const void *>(VT_DEFAULT_VALUE);
  }
  template<typename T> const T *default_value_as() const;
  const hipdnn_data_sdk::data_objects::IntValue *default_value_as_IntValue() const {
    return default_value_type() == hipdnn_data_sdk::data_objects::KnobValue::IntValue ? static_cast<const hipdnn_data_sdk::data_objects::IntValue *>(default_value()) : nullptr;
  }
  const hipdnn_data_sdk::data_objects::FloatValue *default_value_as_FloatValue() const {
    return default_value_type() == hipdnn_data_sdk::data_objects::KnobValue::FloatValue ? static_cast<const hipdnn_data_sdk::data_objects::FloatValue *>(default_value()) : nullptr;
  }
  const hipdnn_data_sdk::data_objects::StringValue *default_value_as_StringValue() const {
    return default_value_type() == hipdnn_data_sdk::data_objects::KnobValue::StringValue ? static_cast<const hipdnn_data_sdk::data_objects::StringValue *>(default_value()) : nullptr;
  }
  void *mutable_default_value() {
    return GetPointer<void *>(VT_DEFAULT_VALUE);
  }
  hipdnn_data_sdk::data_objects::KnobConstraint constraints_type() const {
    return static_cast<hipdnn_data_sdk::data_objects::KnobConstraint>(GetField<uint8_t>(VT_CONSTRAINTS_TYPE, 0));
  }
  const void *constraints() const {
    return GetPointer<const void *>(VT_CONSTRAINTS);
  }
  template<typename T> const T *constraints_as() const;
  const hipdnn_data_sdk::data_objects::IntConstraint *constraints_as_IntConstraint() const {
    return constraints_type() == hipdnn_data_sdk::data_objects::KnobConstraint::IntConstraint ? static_cast<const hipdnn_data_sdk::data_objects::IntConstraint *>(constraints()) : nullptr;
  }
  const hipdnn_data_sdk::data_objects::FloatConstraint *constraints_as_FloatConstraint() const {
    return constraints_type() == hipdnn_data_sdk::data_objects::KnobConstraint::FloatConstraint ? static_cast<const hipdnn_data_sdk::data_objects::FloatConstraint *>(constraints()) : nullptr;
  }
  const hipdnn_data_sdk::data_objects::StringConstraint *constraints_as_StringConstraint() const {
    return constraints_type() == hipdnn_data_sdk::data_objects::KnobConstraint::StringConstraint ? static_cast<const hipdnn_data_sdk::data_objects::StringConstraint *>(constraints()) : nullptr;
  }
  void *mutable_constraints() {
    return GetPointer<void *>(VT_CONSTRAINTS);
  }
  bool deprecated() const {
    return GetField<uint8_t>(VT_DEPRECATED, 0) != 0;
  }
  bool mutate_deprecated(bool _deprecated = 0) {
    return SetField<uint8_t>(VT_DEPRECATED, static_cast<uint8_t>(_deprecated), 0);
  }
  bool Verify(::flatbuffers::Verifier &verifier) const {
    return VerifyTableStart(verifier) &&
           VerifyField<int64_t>(verifier, VT_KNOB_ID, 8) &&
           VerifyOffset(verifier, VT_KNOB_ID_STR) &&
           verifier.VerifyString(knob_id_str()) &&
           VerifyOffset(verifier, VT_DESCRIPTION) &&
           verifier.VerifyString(description()) &&
           VerifyField<uint8_t>(verifier, VT_VALUE_TYPE_TYPE, 1) &&
           VerifyOffset(verifier, VT_VALUE_TYPE) &&
           VerifyKnobValue(verifier, value_type(), value_type_type()) &&
           VerifyField<uint8_t>(verifier, VT_DEFAULT_VALUE_TYPE, 1) &&
           VerifyOffset(verifier, VT_DEFAULT_VALUE) &&
           VerifyKnobValue(verifier, default_value(), default_value_type()) &&
           VerifyField<uint8_t>(verifier, VT_CONSTRAINTS_TYPE, 1) &&
           VerifyOffset(verifier, VT_CONSTRAINTS) &&
           VerifyKnobConstraint(verifier, constraints(), constraints_type()) &&
           VerifyField<uint8_t>(verifier, VT_DEPRECATED, 1) &&
           verifier.EndTable();
  }
  KnobT *UnPack(const ::flatbuffers::resolver_function_t *_resolver = nullptr) const;
  void UnPackTo(KnobT *_o, const ::flatbuffers::resolver_function_t *_resolver = nullptr) const;
  static ::flatbuffers::Offset<Knob> Pack(::flatbuffers::FlatBufferBuilder &_fbb, const KnobT* _o, const ::flatbuffers::rehasher_function_t *_rehasher = nullptr);
};

template<> inline const hipdnn_data_sdk::data_objects::IntValue *Knob::value_type_as<hipdnn_data_sdk::data_objects::IntValue>() const {
  return value_type_as_IntValue();
}

template<> inline const hipdnn_data_sdk::data_objects::FloatValue *Knob::value_type_as<hipdnn_data_sdk::data_objects::FloatValue>() const {
  return value_type_as_FloatValue();
}

template<> inline const hipdnn_data_sdk::data_objects::StringValue *Knob::value_type_as<hipdnn_data_sdk::data_objects::StringValue>() const {
  return value_type_as_StringValue();
}

template<> inline const hipdnn_data_sdk::data_objects::IntValue *Knob::default_value_as<hipdnn_data_sdk::data_objects::IntValue>() const {
  return default_value_as_IntValue();
}

template<> inline const hipdnn_data_sdk::data_objects::FloatValue *Knob::default_value_as<hipdnn_data_sdk::data_objects::FloatValue>() const {
  return default_value_as_FloatValue();
}

template<> inline const hipdnn_data_sdk::data_objects::StringValue *Knob::default_value_as<hipdnn_data_sdk::data_objects::StringValue>() const {
  return default_value_as_StringValue();
}

template<> inline const hipdnn_data_sdk::data_objects::IntConstraint *Knob::constraints_as<hipdnn_data_sdk::data_objects::IntConstraint>() const {
  return constraints_as_IntConstraint();
}

template<> inline const hipdnn_data_sdk::data_objects::FloatConstraint *Knob::constraints_as<hipdnn_data_sdk::data_objects::FloatConstraint>() const {
  return constraints_as_FloatConstraint();
}

template<> inline const hipdnn_data_sdk::data_objects::StringConstraint *Knob::constraints_as<hipdnn_data_sdk::data_objects::StringConstraint>() const {
  return constraints_as_StringConstraint();
}

struct KnobBuilder {
  typedef Knob Table;
  ::flatbuffers::FlatBufferBuilder &fbb_;
  ::flatbuffers::uoffset_t start_;
  void add_knob_id(int64_t knob_id) {
    fbb_.AddElement<int64_t>(Knob::VT_KNOB_ID, knob_id, 0);
  }
  void add_knob_id_str(::flatbuffers::Offset<::flatbuffers::String> knob_id_str) {
    fbb_.AddOffset(Knob::VT_KNOB_ID_STR, knob_id_str);
  }
  void add_description(::flatbuffers::Offset<::flatbuffers::String> description) {
    fbb_.AddOffset(Knob::VT_DESCRIPTION, description);
  }
  void add_value_type_type(hipdnn_data_sdk::data_objects::KnobValue value_type_type) {
    fbb_.AddElement<uint8_t>(Knob::VT_VALUE_TYPE_TYPE, static_cast<uint8_t>(value_type_type), 0);
  }
  void add_value_type(::flatbuffers::Offset<void> value_type) {
    fbb_.AddOffset(Knob::VT_VALUE_TYPE, value_type);
  }
  void add_default_value_type(hipdnn_data_sdk::data_objects::KnobValue default_value_type) {
    fbb_.AddElement<uint8_t>(Knob::VT_DEFAULT_VALUE_TYPE, static_cast<uint8_t>(default_value_type), 0);
  }
  void add_default_value(::flatbuffers::Offset<void> default_value) {
    fbb_.AddOffset(Knob::VT_DEFAULT_VALUE, default_value);
  }
  void add_constraints_type(hipdnn_data_sdk::data_objects::KnobConstraint constraints_type) {
    fbb_.AddElement<uint8_t>(Knob::VT_CONSTRAINTS_TYPE, static_cast<uint8_t>(constraints_type), 0);
  }
  void add_constraints(::flatbuffers::Offset<void> constraints) {
    fbb_.AddOffset(Knob::VT_CONSTRAINTS, constraints);
  }
  void add_deprecated(bool deprecated) {
    fbb_.AddElement<uint8_t>(Knob::VT_DEPRECATED, static_cast<uint8_t>(deprecated), 0);
  }
  explicit KnobBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
        : fbb_(_fbb) {
    start_ = fbb_.StartTable();
  }
  ::flatbuffers::Offset<Knob> Finish() {
    const auto end = fbb_.EndTable(start_);
    auto o = ::flatbuffers::Offset<Knob>(end);
    return o;
  }
};

inline ::flatbuffers::Offset<Knob> CreateKnob(
    ::flatbuffers::FlatBufferBuilder &_fbb,
    int64_t knob_id = 0,
    ::flatbuffers::Offset<::flatbuffers::String> knob_id_str = 0,
    ::flatbuffers::Offset<::flatbuffers::String> description = 0,
    hipdnn_data_sdk::data_objects::KnobValue value_type_type = hipdnn_data_sdk::data_objects::KnobValue::NONE,
    ::flatbuffers::Offset<void> value_type = 0,
    hipdnn_data_sdk::data_objects::KnobValue default_value_type = hipdnn_data_sdk::data_objects::KnobValue::NONE,
    ::flatbuffers::Offset<void> default_value = 0,
    hipdnn_data_sdk::data_objects::KnobConstraint constraints_type = hipdnn_data_sdk::data_objects::KnobConstraint::NONE,
    ::flatbuffers::Offset<void> constraints = 0,
    bool deprecated = false) {
  KnobBuilder builder_(_fbb);
  builder_.add_knob_id(knob_id);
  builder_.add_constraints(constraints);
  builder_.add_default_value(default_value);
  builder_.add_value_type(value_type);
  builder_.add_description(description);
  builder_.add_knob_id_str(knob_id_str);
  builder_.add_deprecated(deprecated);
  builder_.add_constraints_type(constraints_type);
  builder_.add_default_value_type(default_value_type);
  builder_.add_value_type_type(value_type_type);
  return builder_.Finish();
}

inline ::flatbuffers::Offset<Knob> CreateKnobDirect(
    ::flatbuffers::FlatBufferBuilder &_fbb,
    int64_t knob_id = 0,
    const char *knob_id_str = nullptr,
    const char *description = nullptr,
    hipdnn_data_sdk::data_objects::KnobValue value_type_type = hipdnn_data_sdk::data_objects::KnobValue::NONE,
    ::flatbuffers::Offset<void> value_type = 0,
    hipdnn_data_sdk::data_objects::KnobValue default_value_type = hipdnn_data_sdk::data_objects::KnobValue::NONE,
    ::flatbuffers::Offset<void> default_value = 0,
    hipdnn_data_sdk::data_objects::KnobConstraint constraints_type = hipdnn_data_sdk::data_objects::KnobConstraint::NONE,
    ::flatbuffers::Offset<void> constraints = 0,
    bool deprecated = false) {
  auto knob_id_str__ = knob_id_str ? _fbb.CreateString(knob_id_str) : 0;
  auto description__ = description ? _fbb.CreateString(description) : 0;
  return hipdnn_data_sdk::data_objects::CreateKnob(
      _fbb,
      knob_id,
      knob_id_str__,
      description__,
      value_type_type,
      value_type,
      default_value_type,
      default_value,
      constraints_type,
      constraints,
      deprecated);
}

::flatbuffers::Offset<Knob> CreateKnob(::flatbuffers::FlatBufferBuilder &_fbb, const KnobT *_o, const ::flatbuffers::rehasher_function_t *_rehasher = nullptr);


inline bool operator==(const IntValueT &lhs, const IntValueT &rhs) {
  return
      (lhs.value == rhs.value);
}

inline bool operator!=(const IntValueT &lhs, const IntValueT &rhs) {
    return !(lhs == rhs);
}


inline IntValueT *IntValue::UnPack(const ::flatbuffers::resolver_function_t *_resolver) const {
  auto _o = std::unique_ptr<IntValueT>(new IntValueT());
  UnPackTo(_o.get(), _resolver);
  return _o.release();
}

inline void IntValue::UnPackTo(IntValueT *_o, const ::flatbuffers::resolver_function_t *_resolver) const {
  (void)_o;
  (void)_resolver;
  { auto _e = value(); _o->value = _e; }
}

inline ::flatbuffers::Offset<IntValue> IntValue::Pack(::flatbuffers::FlatBufferBuilder &_fbb, const IntValueT* _o, const ::flatbuffers::rehasher_function_t *_rehasher) {
  return CreateIntValue(_fbb, _o, _rehasher);
}

inline ::flatbuffers::Offset<IntValue> CreateIntValue(::flatbuffers::FlatBufferBuilder &_fbb, const IntValueT *_o, const ::flatbuffers::rehasher_function_t *_rehasher) {
  (void)_rehasher;
  (void)_o;
  struct _VectorArgs { ::flatbuffers::FlatBufferBuilder *__fbb; const IntValueT* __o; const ::flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
  auto _value = _o->value;
  return hipdnn_data_sdk::data_objects::CreateIntValue(
      _fbb,
      _value);
}


inline bool operator==(const FloatValueT &lhs, const FloatValueT &rhs) {
  return
      (lhs.value == rhs.value);
}

inline bool operator!=(const FloatValueT &lhs, const FloatValueT &rhs) {
    return !(lhs == rhs);
}


inline FloatValueT *FloatValue::UnPack(const ::flatbuffers::resolver_function_t *_resolver) const {
  auto _o = std::unique_ptr<FloatValueT>(new FloatValueT());
  UnPackTo(_o.get(), _resolver);
  return _o.release();
}

inline void FloatValue::UnPackTo(FloatValueT *_o, const ::flatbuffers::resolver_function_t *_resolver) const {
  (void)_o;
  (void)_resolver;
  { auto _e = value(); _o->value = _e; }
}

inline ::flatbuffers::Offset<FloatValue> FloatValue::Pack(::flatbuffers::FlatBufferBuilder &_fbb, const FloatValueT* _o, const ::flatbuffers::rehasher_function_t *_rehasher) {
  return CreateFloatValue(_fbb, _o, _rehasher);
}

inline ::flatbuffers::Offset<FloatValue> CreateFloatValue(::flatbuffers::FlatBufferBuilder &_fbb, const FloatValueT *_o, const ::flatbuffers::rehasher_function_t *_rehasher) {
  (void)_rehasher;
  (void)_o;
  struct _VectorArgs { ::flatbuffers::FlatBufferBuilder *__fbb; const FloatValueT* __o; const ::flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
  auto _value = _o->value;
  return hipdnn_data_sdk::data_objects::CreateFloatValue(
      _fbb,
      _value);
}


inline bool operator==(const StringValueT &lhs, const StringValueT &rhs) {
  return
      (lhs.value == rhs.value);
}

inline bool operator!=(const StringValueT &lhs, const StringValueT &rhs) {
    return !(lhs == rhs);
}


inline StringValueT *StringValue::UnPack(const ::flatbuffers::resolver_function_t *_resolver) const {
  auto _o = std::unique_ptr<StringValueT>(new StringValueT());
  UnPackTo(_o.get(), _resolver);
  return _o.release();
}

inline void StringValue::UnPackTo(StringValueT *_o, const ::flatbuffers::resolver_function_t *_resolver) const {
  (void)_o;
  (void)_resolver;
  { auto _e = value(); if (_e) _o->value = _e->str(); }
}

inline ::flatbuffers::Offset<StringValue> StringValue::Pack(::flatbuffers::FlatBufferBuilder &_fbb, const StringValueT* _o, const ::flatbuffers::rehasher_function_t *_rehasher) {
  return CreateStringValue(_fbb, _o, _rehasher);
}

inline ::flatbuffers::Offset<StringValue> CreateStringValue(::flatbuffers::FlatBufferBuilder &_fbb, const StringValueT *_o, const ::flatbuffers::rehasher_function_t *_rehasher) {
  (void)_rehasher;
  (void)_o;
  struct _VectorArgs { ::flatbuffers::FlatBufferBuilder *__fbb; const StringValueT* __o; const ::flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
  auto _value = _o->value.empty() ? 0 : _fbb.CreateString(_o->value);
  return hipdnn_data_sdk::data_objects::CreateStringValue(
      _fbb,
      _value);
}


inline bool operator==(const IntConstraintT &lhs, const IntConstraintT &rhs) {
  return
      (lhs.min_value == rhs.min_value) &&
      (lhs.max_value == rhs.max_value) &&
      (lhs.step == rhs.step) &&
      (lhs.valid_values == rhs.valid_values);
}

inline bool operator!=(const IntConstraintT &lhs, const IntConstraintT &rhs) {
    return !(lhs == rhs);
}


inline IntConstraintT *IntConstraint::UnPack(const ::flatbuffers::resolver_function_t *_resolver) const {
  auto _o = std::unique_ptr<IntConstraintT>(new IntConstraintT());
  UnPackTo(_o.get(), _resolver);
  return _o.release();
}

inline void IntConstraint::UnPackTo(IntConstraintT *_o, const ::flatbuffers::resolver_function_t *_resolver) const {
  (void)_o;
  (void)_resolver;
  { auto _e = min_value(); _o->min_value = _e; }
  { auto _e = max_value(); _o->max_value = _e; }
  { auto _e = step(); _o->step = _e; }
  { auto _e = valid_values(); if (_e) { _o->valid_values.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->valid_values[_i] = _e->Get(_i); } } else { _o->valid_values.resize(0); } }
}

inline ::flatbuffers::Offset<IntConstraint> IntConstraint::Pack(::flatbuffers::FlatBufferBuilder &_fbb, const IntConstraintT* _o, const ::flatbuffers::rehasher_function_t *_rehasher) {
  return CreateIntConstraint(_fbb, _o, _rehasher);
}

inline ::flatbuffers::Offset<IntConstraint> CreateIntConstraint(::flatbuffers::FlatBufferBuilder &_fbb, const IntConstraintT *_o, const ::flatbuffers::rehasher_function_t *_rehasher) {
  (void)_rehasher;
  (void)_o;
  struct _VectorArgs { ::flatbuffers::FlatBufferBuilder *__fbb; const IntConstraintT* __o; const ::flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
  auto _min_value = _o->min_value;
  auto _max_value = _o->max_value;
  auto _step = _o->step;
  auto _valid_values = _o->valid_values.size() ? _fbb.CreateVector(_o->valid_values) : 0;
  return hipdnn_data_sdk::data_objects::CreateIntConstraint(
      _fbb,
      _min_value,
      _max_value,
      _step,
      _valid_values);
}


inline bool operator==(const FloatConstraintT &lhs, const FloatConstraintT &rhs) {
  return
      (lhs.min_value == rhs.min_value) &&
      (lhs.max_value == rhs.max_value) &&
      (lhs.valid_values == rhs.valid_values);
}

inline bool operator!=(const FloatConstraintT &lhs, const FloatConstraintT &rhs) {
    return !(lhs == rhs);
}


inline FloatConstraintT *FloatConstraint::UnPack(const ::flatbuffers::resolver_function_t *_resolver) const {
  auto _o = std::unique_ptr<FloatConstraintT>(new FloatConstraintT());
  UnPackTo(_o.get(), _resolver);
  return _o.release();
}

inline void FloatConstraint::UnPackTo(FloatConstraintT *_o, const ::flatbuffers::resolver_function_t *_resolver) const {
  (void)_o;
  (void)_resolver;
  { auto _e = min_value(); _o->min_value = _e; }
  { auto _e = max_value(); _o->max_value = _e; }
  { auto _e = valid_values(); if (_e) { _o->valid_values.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->valid_values[_i] = _e->Get(_i); } } else { _o->valid_values.resize(0); } }
}

inline ::flatbuffers::Offset<FloatConstraint> FloatConstraint::Pack(::flatbuffers::FlatBufferBuilder &_fbb, const FloatConstraintT* _o, const ::flatbuffers::rehasher_function_t *_rehasher) {
  return CreateFloatConstraint(_fbb, _o, _rehasher);
}

inline ::flatbuffers::Offset<FloatConstraint> CreateFloatConstraint(::flatbuffers::FlatBufferBuilder &_fbb, const FloatConstraintT *_o, const ::flatbuffers::rehasher_function_t *_rehasher) {
  (void)_rehasher;
  (void)_o;
  struct _VectorArgs { ::flatbuffers::FlatBufferBuilder *__fbb; const FloatConstraintT* __o; const ::flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
  auto _min_value = _o->min_value;
  auto _max_value = _o->max_value;
  auto _valid_values = _o->valid_values.size() ? _fbb.CreateVector(_o->valid_values) : 0;
  return hipdnn_data_sdk::data_objects::CreateFloatConstraint(
      _fbb,
      _min_value,
      _max_value,
      _valid_values);
}


inline bool operator==(const StringConstraintT &lhs, const StringConstraintT &rhs) {
  return
      (lhs.max_length == rhs.max_length) &&
      (lhs.valid_values == rhs.valid_values);
}

inline bool operator!=(const StringConstraintT &lhs, const StringConstraintT &rhs) {
    return !(lhs == rhs);
}


inline StringConstraintT *StringConstraint::UnPack(const ::flatbuffers::resolver_function_t *_resolver) const {
  auto _o = std::unique_ptr<StringConstraintT>(new StringConstraintT());
  UnPackTo(_o.get(), _resolver);
  return _o.release();
}

inline void StringConstraint::UnPackTo(StringConstraintT *_o, const ::flatbuffers::resolver_function_t *_resolver) const {
  (void)_o;
  (void)_resolver;
  { auto _e = max_length(); _o->max_length = _e; }
  { auto _e = valid_values(); if (_e) { _o->valid_values.resize(_e->size()); for (::flatbuffers::uoffset_t _i = 0; _i < _e->size(); _i++) { _o->valid_values[_i] = _e->Get(_i)->str(); } } else { _o->valid_values.resize(0); } }
}

inline ::flatbuffers::Offset<StringConstraint> StringConstraint::Pack(::flatbuffers::FlatBufferBuilder &_fbb, const StringConstraintT* _o, const ::flatbuffers::rehasher_function_t *_rehasher) {
  return CreateStringConstraint(_fbb, _o, _rehasher);
}

inline ::flatbuffers::Offset<StringConstraint> CreateStringConstraint(::flatbuffers::FlatBufferBuilder &_fbb, const StringConstraintT *_o, const ::flatbuffers::rehasher_function_t *_rehasher) {
  (void)_rehasher;
  (void)_o;
  struct _VectorArgs { ::flatbuffers::FlatBufferBuilder *__fbb; const StringConstraintT* __o; const ::flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
  auto _max_length = _o->max_length;
  auto _valid_values = _o->valid_values.size() ? _fbb.CreateVectorOfStrings(_o->valid_values) : 0;
  return hipdnn_data_sdk::data_objects::CreateStringConstraint(
      _fbb,
      _max_length,
      _valid_values);
}


inline bool operator==(const KnobT &lhs, const KnobT &rhs) {
  return
      (lhs.knob_id == rhs.knob_id) &&
      (lhs.knob_id_str == rhs.knob_id_str) &&
      (lhs.description == rhs.description) &&
      (lhs.value_type == rhs.value_type) &&
      (lhs.default_value == rhs.default_value) &&
      (lhs.constraints == rhs.constraints) &&
      (lhs.deprecated == rhs.deprecated);
}

inline bool operator!=(const KnobT &lhs, const KnobT &rhs) {
    return !(lhs == rhs);
}


inline KnobT *Knob::UnPack(const ::flatbuffers::resolver_function_t *_resolver) const {
  auto _o = std::unique_ptr<KnobT>(new KnobT());
  UnPackTo(_o.get(), _resolver);
  return _o.release();
}

inline void Knob::UnPackTo(KnobT *_o, const ::flatbuffers::resolver_function_t *_resolver) const {
  (void)_o;
  (void)_resolver;
  { auto _e = knob_id(); _o->knob_id = _e; }
  { auto _e = knob_id_str(); if (_e) _o->knob_id_str = _e->str(); }
  { auto _e = description(); if (_e) _o->description = _e->str(); }
  { auto _e = value_type_type(); _o->value_type.type = _e; }
  { auto _e = value_type(); if (_e) _o->value_type.value = hipdnn_data_sdk::data_objects::KnobValueUnion::UnPack(_e, value_type_type(), _resolver); }
  { auto _e = default_value_type(); _o->default_value.type = _e; }
  { auto _e = default_value(); if (_e) _o->default_value.value = hipdnn_data_sdk::data_objects::KnobValueUnion::UnPack(_e, default_value_type(), _resolver); }
  { auto _e = constraints_type(); _o->constraints.type = _e; }
  { auto _e = constraints(); if (_e) _o->constraints.value = hipdnn_data_sdk::data_objects::KnobConstraintUnion::UnPack(_e, constraints_type(), _resolver); }
  { auto _e = deprecated(); _o->deprecated = _e; }
}

inline ::flatbuffers::Offset<Knob> Knob::Pack(::flatbuffers::FlatBufferBuilder &_fbb, const KnobT* _o, const ::flatbuffers::rehasher_function_t *_rehasher) {
  return CreateKnob(_fbb, _o, _rehasher);
}

inline ::flatbuffers::Offset<Knob> CreateKnob(::flatbuffers::FlatBufferBuilder &_fbb, const KnobT *_o, const ::flatbuffers::rehasher_function_t *_rehasher) {
  (void)_rehasher;
  (void)_o;
  struct _VectorArgs { ::flatbuffers::FlatBufferBuilder *__fbb; const KnobT* __o; const ::flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
  auto _knob_id = _o->knob_id;
  auto _knob_id_str = _o->knob_id_str.empty() ? 0 : _fbb.CreateString(_o->knob_id_str);
  auto _description = _o->description.empty() ? 0 : _fbb.CreateString(_o->description);
  auto _value_type_type = _o->value_type.type;
  auto _value_type = _o->value_type.Pack(_fbb);
  auto _default_value_type = _o->default_value.type;
  auto _default_value = _o->default_value.Pack(_fbb);
  auto _constraints_type = _o->constraints.type;
  auto _constraints = _o->constraints.Pack(_fbb);
  auto _deprecated = _o->deprecated;
  return hipdnn_data_sdk::data_objects::CreateKnob(
      _fbb,
      _knob_id,
      _knob_id_str,
      _description,
      _value_type_type,
      _value_type,
      _default_value_type,
      _default_value,
      _constraints_type,
      _constraints,
      _deprecated);
}

inline bool VerifyKnobValue(::flatbuffers::Verifier &verifier, const void *obj, KnobValue type) {
  switch (type) {
    case KnobValue::NONE: {
      return true;
    }
    case KnobValue::IntValue: {
      auto ptr = reinterpret_cast<const hipdnn_data_sdk::data_objects::IntValue *>(obj);
      return verifier.VerifyTable(ptr);
    }
    case KnobValue::FloatValue: {
      auto ptr = reinterpret_cast<const hipdnn_data_sdk::data_objects::FloatValue *>(obj);
      return verifier.VerifyTable(ptr);
    }
    case KnobValue::StringValue: {
      auto ptr = reinterpret_cast<const hipdnn_data_sdk::data_objects::StringValue *>(obj);
      return verifier.VerifyTable(ptr);
    }
    default: return true;
  }
}

inline bool VerifyKnobValueVector(::flatbuffers::Verifier &verifier, const ::flatbuffers::Vector<::flatbuffers::Offset<void>> *values, const ::flatbuffers::Vector<KnobValue> *types) {
  if (!values || !types) return !values && !types;
  if (values->size() != types->size()) return false;
  for (::flatbuffers::uoffset_t i = 0; i < values->size(); ++i) {
    if (!VerifyKnobValue(
        verifier,  values->Get(i), types->GetEnum<KnobValue>(i))) {
      return false;
    }
  }
  return true;
}

inline void *KnobValueUnion::UnPack(const void *obj, KnobValue type, const ::flatbuffers::resolver_function_t *resolver) {
  (void)resolver;
  switch (type) {
    case KnobValue::IntValue: {
      auto ptr = reinterpret_cast<const hipdnn_data_sdk::data_objects::IntValue *>(obj);
      return ptr->UnPack(resolver);
    }
    case KnobValue::FloatValue: {
      auto ptr = reinterpret_cast<const hipdnn_data_sdk::data_objects::FloatValue *>(obj);
      return ptr->UnPack(resolver);
    }
    case KnobValue::StringValue: {
      auto ptr = reinterpret_cast<const hipdnn_data_sdk::data_objects::StringValue *>(obj);
      return ptr->UnPack(resolver);
    }
    default: return nullptr;
  }
}

inline ::flatbuffers::Offset<void> KnobValueUnion::Pack(::flatbuffers::FlatBufferBuilder &_fbb, const ::flatbuffers::rehasher_function_t *_rehasher) const {
  (void)_rehasher;
  switch (type) {
    case KnobValue::IntValue: {
      auto ptr = reinterpret_cast<const hipdnn_data_sdk::data_objects::IntValueT *>(value);
      return CreateIntValue(_fbb, ptr, _rehasher).Union();
    }
    case KnobValue::FloatValue: {
      auto ptr = reinterpret_cast<const hipdnn_data_sdk::data_objects::FloatValueT *>(value);
      return CreateFloatValue(_fbb, ptr, _rehasher).Union();
    }
    case KnobValue::StringValue: {
      auto ptr = reinterpret_cast<const hipdnn_data_sdk::data_objects::StringValueT *>(value);
      return CreateStringValue(_fbb, ptr, _rehasher).Union();
    }
    default: return 0;
  }
}

inline KnobValueUnion::KnobValueUnion(const KnobValueUnion &u) : type(u.type), value(nullptr) {
  switch (type) {
    case KnobValue::IntValue: {
      value = new hipdnn_data_sdk::data_objects::IntValueT(*reinterpret_cast<hipdnn_data_sdk::data_objects::IntValueT *>(u.value));
      break;
    }
    case KnobValue::FloatValue: {
      value = new hipdnn_data_sdk::data_objects::FloatValueT(*reinterpret_cast<hipdnn_data_sdk::data_objects::FloatValueT *>(u.value));
      break;
    }
    case KnobValue::StringValue: {
      value = new hipdnn_data_sdk::data_objects::StringValueT(*reinterpret_cast<hipdnn_data_sdk::data_objects::StringValueT *>(u.value));
      break;
    }
    default:
      break;
  }
}

inline void KnobValueUnion::Reset() {
  switch (type) {
    case KnobValue::IntValue: {
      auto ptr = reinterpret_cast<hipdnn_data_sdk::data_objects::IntValueT *>(value);
      delete ptr;
      break;
    }
    case KnobValue::FloatValue: {
      auto ptr = reinterpret_cast<hipdnn_data_sdk::data_objects::FloatValueT *>(value);
      delete ptr;
      break;
    }
    case KnobValue::StringValue: {
      auto ptr = reinterpret_cast<hipdnn_data_sdk::data_objects::StringValueT *>(value);
      delete ptr;
      break;
    }
    default: break;
  }
  value = nullptr;
  type = KnobValue::NONE;
}

inline bool VerifyKnobConstraint(::flatbuffers::Verifier &verifier, const void *obj, KnobConstraint type) {
  switch (type) {
    case KnobConstraint::NONE: {
      return true;
    }
    case KnobConstraint::IntConstraint: {
      auto ptr = reinterpret_cast<const hipdnn_data_sdk::data_objects::IntConstraint *>(obj);
      return verifier.VerifyTable(ptr);
    }
    case KnobConstraint::FloatConstraint: {
      auto ptr = reinterpret_cast<const hipdnn_data_sdk::data_objects::FloatConstraint *>(obj);
      return verifier.VerifyTable(ptr);
    }
    case KnobConstraint::StringConstraint: {
      auto ptr = reinterpret_cast<const hipdnn_data_sdk::data_objects::StringConstraint *>(obj);
      return verifier.VerifyTable(ptr);
    }
    default: return true;
  }
}

inline bool VerifyKnobConstraintVector(::flatbuffers::Verifier &verifier, const ::flatbuffers::Vector<::flatbuffers::Offset<void>> *values, const ::flatbuffers::Vector<KnobConstraint> *types) {
  if (!values || !types) return !values && !types;
  if (values->size() != types->size()) return false;
  for (::flatbuffers::uoffset_t i = 0; i < values->size(); ++i) {
    if (!VerifyKnobConstraint(
        verifier,  values->Get(i), types->GetEnum<KnobConstraint>(i))) {
      return false;
    }
  }
  return true;
}

inline void *KnobConstraintUnion::UnPack(const void *obj, KnobConstraint type, const ::flatbuffers::resolver_function_t *resolver) {
  (void)resolver;
  switch (type) {
    case KnobConstraint::IntConstraint: {
      auto ptr = reinterpret_cast<const hipdnn_data_sdk::data_objects::IntConstraint *>(obj);
      return ptr->UnPack(resolver);
    }
    case KnobConstraint::FloatConstraint: {
      auto ptr = reinterpret_cast<const hipdnn_data_sdk::data_objects::FloatConstraint *>(obj);
      return ptr->UnPack(resolver);
    }
    case KnobConstraint::StringConstraint: {
      auto ptr = reinterpret_cast<const hipdnn_data_sdk::data_objects::StringConstraint *>(obj);
      return ptr->UnPack(resolver);
    }
    default: return nullptr;
  }
}

inline ::flatbuffers::Offset<void> KnobConstraintUnion::Pack(::flatbuffers::FlatBufferBuilder &_fbb, const ::flatbuffers::rehasher_function_t *_rehasher) const {
  (void)_rehasher;
  switch (type) {
    case KnobConstraint::IntConstraint: {
      auto ptr = reinterpret_cast<const hipdnn_data_sdk::data_objects::IntConstraintT *>(value);
      return CreateIntConstraint(_fbb, ptr, _rehasher).Union();
    }
    case KnobConstraint::FloatConstraint: {
      auto ptr = reinterpret_cast<const hipdnn_data_sdk::data_objects::FloatConstraintT *>(value);
      return CreateFloatConstraint(_fbb, ptr, _rehasher).Union();
    }
    case KnobConstraint::StringConstraint: {
      auto ptr = reinterpret_cast<const hipdnn_data_sdk::data_objects::StringConstraintT *>(value);
      return CreateStringConstraint(_fbb, ptr, _rehasher).Union();
    }
    default: return 0;
  }
}

inline KnobConstraintUnion::KnobConstraintUnion(const KnobConstraintUnion &u) : type(u.type), value(nullptr) {
  switch (type) {
    case KnobConstraint::IntConstraint: {
      value = new hipdnn_data_sdk::data_objects::IntConstraintT(*reinterpret_cast<hipdnn_data_sdk::data_objects::IntConstraintT *>(u.value));
      break;
    }
    case KnobConstraint::FloatConstraint: {
      value = new hipdnn_data_sdk::data_objects::FloatConstraintT(*reinterpret_cast<hipdnn_data_sdk::data_objects::FloatConstraintT *>(u.value));
      break;
    }
    case KnobConstraint::StringConstraint: {
      value = new hipdnn_data_sdk::data_objects::StringConstraintT(*reinterpret_cast<hipdnn_data_sdk::data_objects::StringConstraintT *>(u.value));
      break;
    }
    default:
      break;
  }
}

inline void KnobConstraintUnion::Reset() {
  switch (type) {
    case KnobConstraint::IntConstraint: {
      auto ptr = reinterpret_cast<hipdnn_data_sdk::data_objects::IntConstraintT *>(value);
      delete ptr;
      break;
    }
    case KnobConstraint::FloatConstraint: {
      auto ptr = reinterpret_cast<hipdnn_data_sdk::data_objects::FloatConstraintT *>(value);
      delete ptr;
      break;
    }
    case KnobConstraint::StringConstraint: {
      auto ptr = reinterpret_cast<hipdnn_data_sdk::data_objects::StringConstraintT *>(value);
      delete ptr;
      break;
    }
    default: break;
  }
  value = nullptr;
  type = KnobConstraint::NONE;
}

}  // namespace data_objects
}  // namespace hipdnn_data_sdk

#endif  // FLATBUFFERS_GENERATED_KNOBVALUE_HIPDNN_DATA_SDK_DATA_OBJECTS_H_
