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


#ifndef FLATBUFFERS_GENERATED_REDUCTIONATTRIBUTES_HIPDNN_FLATBUFFERS_SDK_DATA_OBJECTS_H_
#define FLATBUFFERS_GENERATED_REDUCTIONATTRIBUTES_HIPDNN_FLATBUFFERS_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");

#include "data_types_generated.h"

namespace hipdnn_flatbuffers_sdk {
namespace data_objects {

struct ReductionAttributes;
struct ReductionAttributesBuilder;
struct ReductionAttributesT;

bool operator==(const ReductionAttributesT &lhs, const ReductionAttributesT &rhs);
bool operator!=(const ReductionAttributesT &lhs, const ReductionAttributesT &rhs);

enum class ReductionMode : int8_t {
  NOT_SET = 0,
  ADD = 1,
  MUL = 2,
  MIN_OP = 3,
  MAX_OP = 4,
  AMAX = 5,
  AVG = 6,
  NORM1 = 7,
  NORM2 = 8,
  MUL_NO_ZEROS = 9,
  MIN = NOT_SET,
  MAX = MUL_NO_ZEROS
};

inline const ReductionMode (&EnumValuesReductionMode())[10] {
  static const ReductionMode values[] = {
    ReductionMode::NOT_SET,
    ReductionMode::ADD,
    ReductionMode::MUL,
    ReductionMode::MIN_OP,
    ReductionMode::MAX_OP,
    ReductionMode::AMAX,
    ReductionMode::AVG,
    ReductionMode::NORM1,
    ReductionMode::NORM2,
    ReductionMode::MUL_NO_ZEROS
  };
  return values;
}

inline const char * const *EnumNamesReductionMode() {
  static const char * const names[11] = {
    "NOT_SET",
    "ADD",
    "MUL",
    "MIN_OP",
    "MAX_OP",
    "AMAX",
    "AVG",
    "NORM1",
    "NORM2",
    "MUL_NO_ZEROS",
    nullptr
  };
  return names;
}

inline const char *EnumNameReductionMode(ReductionMode e) {
  if (::flatbuffers::IsOutRange(e, ReductionMode::NOT_SET, ReductionMode::MUL_NO_ZEROS)) return "";
  const size_t index = static_cast<size_t>(e);
  return EnumNamesReductionMode()[index];
}

struct ReductionAttributesT : public ::flatbuffers::NativeTable {
  typedef ReductionAttributes TableType;
  hipdnn_flatbuffers_sdk::data_objects::ReductionMode mode = hipdnn_flatbuffers_sdk::data_objects::ReductionMode::NOT_SET;
  int64_t in_tensor_uid = 0;
  int64_t out_tensor_uid = 0;
  bool is_deterministic = false;
};

struct ReductionAttributes FLATBUFFERS_FINAL_CLASS : private ::flatbuffers::Table {
  typedef ReductionAttributesT NativeTableType;
  typedef ReductionAttributesBuilder Builder;
  enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
    VT_MODE = 4,
    VT_IN_TENSOR_UID = 6,
    VT_OUT_TENSOR_UID = 8,
    VT_IS_DETERMINISTIC = 10
  };
  hipdnn_flatbuffers_sdk::data_objects::ReductionMode mode() const {
    return static_cast<hipdnn_flatbuffers_sdk::data_objects::ReductionMode>(GetField<int8_t>(VT_MODE, 0));
  }
  bool mutate_mode(hipdnn_flatbuffers_sdk::data_objects::ReductionMode _mode = static_cast<hipdnn_flatbuffers_sdk::data_objects::ReductionMode>(0)) {
    return SetField<int8_t>(VT_MODE, static_cast<int8_t>(_mode), 0);
  }
  int64_t in_tensor_uid() const {
    return GetField<int64_t>(VT_IN_TENSOR_UID, 0);
  }
  bool mutate_in_tensor_uid(int64_t _in_tensor_uid = 0) {
    return SetField<int64_t>(VT_IN_TENSOR_UID, _in_tensor_uid, 0);
  }
  int64_t out_tensor_uid() const {
    return GetField<int64_t>(VT_OUT_TENSOR_UID, 0);
  }
  bool mutate_out_tensor_uid(int64_t _out_tensor_uid = 0) {
    return SetField<int64_t>(VT_OUT_TENSOR_UID, _out_tensor_uid, 0);
  }
  bool is_deterministic() const {
    return GetField<uint8_t>(VT_IS_DETERMINISTIC, 0) != 0;
  }
  bool mutate_is_deterministic(bool _is_deterministic = 0) {
    return SetField<uint8_t>(VT_IS_DETERMINISTIC, static_cast<uint8_t>(_is_deterministic), 0);
  }
  bool Verify(::flatbuffers::Verifier &verifier) const {
    return VerifyTableStart(verifier) &&
           VerifyField<int8_t>(verifier, VT_MODE, 1) &&
           VerifyField<int64_t>(verifier, VT_IN_TENSOR_UID, 8) &&
           VerifyField<int64_t>(verifier, VT_OUT_TENSOR_UID, 8) &&
           VerifyField<uint8_t>(verifier, VT_IS_DETERMINISTIC, 1) &&
           verifier.EndTable();
  }
  ReductionAttributesT *UnPack(const ::flatbuffers::resolver_function_t *_resolver = nullptr) const;
  void UnPackTo(ReductionAttributesT *_o, const ::flatbuffers::resolver_function_t *_resolver = nullptr) const;
  static ::flatbuffers::Offset<ReductionAttributes> Pack(::flatbuffers::FlatBufferBuilder &_fbb, const ReductionAttributesT* _o, const ::flatbuffers::rehasher_function_t *_rehasher = nullptr);
};

struct ReductionAttributesBuilder {
  typedef ReductionAttributes Table;
  ::flatbuffers::FlatBufferBuilder &fbb_;
  ::flatbuffers::uoffset_t start_;
  void add_mode(hipdnn_flatbuffers_sdk::data_objects::ReductionMode mode) {
    fbb_.AddElement<int8_t>(ReductionAttributes::VT_MODE, static_cast<int8_t>(mode), 0);
  }
  void add_in_tensor_uid(int64_t in_tensor_uid) {
    fbb_.AddElement<int64_t>(ReductionAttributes::VT_IN_TENSOR_UID, in_tensor_uid, 0);
  }
  void add_out_tensor_uid(int64_t out_tensor_uid) {
    fbb_.AddElement<int64_t>(ReductionAttributes::VT_OUT_TENSOR_UID, out_tensor_uid, 0);
  }
  void add_is_deterministic(bool is_deterministic) {
    fbb_.AddElement<uint8_t>(ReductionAttributes::VT_IS_DETERMINISTIC, static_cast<uint8_t>(is_deterministic), 0);
  }
  explicit ReductionAttributesBuilder(::flatbuffers::FlatBufferBuilder &_fbb)
        : fbb_(_fbb) {
    start_ = fbb_.StartTable();
  }
  ::flatbuffers::Offset<ReductionAttributes> Finish() {
    const auto end = fbb_.EndTable(start_);
    auto o = ::flatbuffers::Offset<ReductionAttributes>(end);
    return o;
  }
};

inline ::flatbuffers::Offset<ReductionAttributes> CreateReductionAttributes(
    ::flatbuffers::FlatBufferBuilder &_fbb,
    hipdnn_flatbuffers_sdk::data_objects::ReductionMode mode = hipdnn_flatbuffers_sdk::data_objects::ReductionMode::NOT_SET,
    int64_t in_tensor_uid = 0,
    int64_t out_tensor_uid = 0,
    bool is_deterministic = false) {
  ReductionAttributesBuilder builder_(_fbb);
  builder_.add_out_tensor_uid(out_tensor_uid);
  builder_.add_in_tensor_uid(in_tensor_uid);
  builder_.add_is_deterministic(is_deterministic);
  builder_.add_mode(mode);
  return builder_.Finish();
}

::flatbuffers::Offset<ReductionAttributes> CreateReductionAttributes(::flatbuffers::FlatBufferBuilder &_fbb, const ReductionAttributesT *_o, const ::flatbuffers::rehasher_function_t *_rehasher = nullptr);


inline bool operator==(const ReductionAttributesT &lhs, const ReductionAttributesT &rhs) {
  return
      (lhs.mode == rhs.mode) &&
      (lhs.in_tensor_uid == rhs.in_tensor_uid) &&
      (lhs.out_tensor_uid == rhs.out_tensor_uid) &&
      (lhs.is_deterministic == rhs.is_deterministic);
}

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


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

inline void ReductionAttributes::UnPackTo(ReductionAttributesT *_o, const ::flatbuffers::resolver_function_t *_resolver) const {
  (void)_o;
  (void)_resolver;
  { auto _e = mode(); _o->mode = _e; }
  { auto _e = in_tensor_uid(); _o->in_tensor_uid = _e; }
  { auto _e = out_tensor_uid(); _o->out_tensor_uid = _e; }
  { auto _e = is_deterministic(); _o->is_deterministic = _e; }
}

inline ::flatbuffers::Offset<ReductionAttributes> ReductionAttributes::Pack(::flatbuffers::FlatBufferBuilder &_fbb, const ReductionAttributesT* _o, const ::flatbuffers::rehasher_function_t *_rehasher) {
  return CreateReductionAttributes(_fbb, _o, _rehasher);
}

inline ::flatbuffers::Offset<ReductionAttributes> CreateReductionAttributes(::flatbuffers::FlatBufferBuilder &_fbb, const ReductionAttributesT *_o, const ::flatbuffers::rehasher_function_t *_rehasher) {
  (void)_rehasher;
  (void)_o;
  struct _VectorArgs { ::flatbuffers::FlatBufferBuilder *__fbb; const ReductionAttributesT* __o; const ::flatbuffers::rehasher_function_t *__rehasher; } _va = { &_fbb, _o, _rehasher}; (void)_va;
  auto _mode = _o->mode;
  auto _in_tensor_uid = _o->in_tensor_uid;
  auto _out_tensor_uid = _o->out_tensor_uid;
  auto _is_deterministic = _o->is_deterministic;
  return hipdnn_flatbuffers_sdk::data_objects::CreateReductionAttributes(
      _fbb,
      _mode,
      _in_tensor_uid,
      _out_tensor_uid,
      _is_deterministic);
}

}  // namespace data_objects
}  // namespace hipdnn_flatbuffers_sdk

#endif  // FLATBUFFERS_GENERATED_REDUCTIONATTRIBUTES_HIPDNN_FLATBUFFERS_SDK_DATA_OBJECTS_H_
