// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: tensorflow/core/profiler/profiler_options.proto

package org.tensorflow.proto.profiler;

/**
 * <pre>
 * Next ID: 11
 * </pre>
 *
 * Protobuf type {@code tensorflow.ProfileOptions}
 */
public  final class ProfileOptions extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:tensorflow.ProfileOptions)
    ProfileOptionsOrBuilder {
private static final long serialVersionUID = 0L;
  // Use ProfileOptions.newBuilder() to construct.
  private ProfileOptions(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private ProfileOptions() {
    deviceType_ = 0;
    repositoryPath_ = "";
  }

  @java.lang.Override
  @SuppressWarnings({"unused"})
  protected java.lang.Object newInstance(
      UnusedPrivateParameter unused) {
    return new ProfileOptions();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private ProfileOptions(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 8: {

            includeDatasetOps_ = input.readBool();
            break;
          }
          case 16: {

            hostTracerLevel_ = input.readUInt32();
            break;
          }
          case 24: {

            deviceTracerLevel_ = input.readUInt32();
            break;
          }
          case 32: {

            pythonTracerLevel_ = input.readUInt32();
            break;
          }
          case 40: {

            version_ = input.readUInt32();
            break;
          }
          case 48: {
            int rawValue = input.readEnum();

            deviceType_ = rawValue;
            break;
          }
          case 56: {

            enableHloProto_ = input.readBool();
            break;
          }
          case 64: {

            startTimestampNs_ = input.readUInt64();
            break;
          }
          case 72: {

            durationMs_ = input.readUInt64();
            break;
          }
          case 82: {
            java.lang.String s = input.readStringRequireUtf8();

            repositoryPath_ = s;
            break;
          }
          default: {
            if (!parseUnknownField(
                input, unknownFields, extensionRegistry, tag)) {
              done = true;
            }
            break;
          }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(
          e).setUnfinishedMessage(this);
    } finally {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return org.tensorflow.proto.profiler.ProfilerOptionsProtos.internal_static_tensorflow_ProfileOptions_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return org.tensorflow.proto.profiler.ProfilerOptionsProtos.internal_static_tensorflow_ProfileOptions_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            org.tensorflow.proto.profiler.ProfileOptions.class, org.tensorflow.proto.profiler.ProfileOptions.Builder.class);
  }

  /**
   * Protobuf enum {@code tensorflow.ProfileOptions.DeviceType}
   */
  public enum DeviceType
      implements com.google.protobuf.ProtocolMessageEnum {
    /**
     * <code>UNSPECIFIED = 0;</code>
     */
    UNSPECIFIED(0),
    /**
     * <code>CPU = 1;</code>
     */
    CPU(1),
    /**
     * <code>GPU = 2;</code>
     */
    GPU(2),
    /**
     * <code>TPU = 3;</code>
     */
    TPU(3),
    /**
     * <code>PLUGGABLE_DEVICE = 4;</code>
     */
    PLUGGABLE_DEVICE(4),
    UNRECOGNIZED(-1),
    ;

    /**
     * <code>UNSPECIFIED = 0;</code>
     */
    public static final int UNSPECIFIED_VALUE = 0;
    /**
     * <code>CPU = 1;</code>
     */
    public static final int CPU_VALUE = 1;
    /**
     * <code>GPU = 2;</code>
     */
    public static final int GPU_VALUE = 2;
    /**
     * <code>TPU = 3;</code>
     */
    public static final int TPU_VALUE = 3;
    /**
     * <code>PLUGGABLE_DEVICE = 4;</code>
     */
    public static final int PLUGGABLE_DEVICE_VALUE = 4;


    public final int getNumber() {
      if (this == UNRECOGNIZED) {
        throw new java.lang.IllegalArgumentException(
            "Can't get the number of an unknown enum value.");
      }
      return value;
    }

    /**
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static DeviceType valueOf(int value) {
      return forNumber(value);
    }

    public static DeviceType forNumber(int value) {
      switch (value) {
        case 0: return UNSPECIFIED;
        case 1: return CPU;
        case 2: return GPU;
        case 3: return TPU;
        case 4: return PLUGGABLE_DEVICE;
        default: return null;
      }
    }

    public static com.google.protobuf.Internal.EnumLiteMap<DeviceType>
        internalGetValueMap() {
      return internalValueMap;
    }
    private static final com.google.protobuf.Internal.EnumLiteMap<
        DeviceType> internalValueMap =
          new com.google.protobuf.Internal.EnumLiteMap<DeviceType>() {
            public DeviceType findValueByNumber(int number) {
              return DeviceType.forNumber(number);
            }
          };

    public final com.google.protobuf.Descriptors.EnumValueDescriptor
        getValueDescriptor() {
      return getDescriptor().getValues().get(ordinal());
    }
    public final com.google.protobuf.Descriptors.EnumDescriptor
        getDescriptorForType() {
      return getDescriptor();
    }
    public static final com.google.protobuf.Descriptors.EnumDescriptor
        getDescriptor() {
      return org.tensorflow.proto.profiler.ProfileOptions.getDescriptor().getEnumTypes().get(0);
    }

    private static final DeviceType[] VALUES = values();

    public static DeviceType valueOf(
        com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
      if (desc.getType() != getDescriptor()) {
        throw new java.lang.IllegalArgumentException(
          "EnumValueDescriptor is not for this type.");
      }
      if (desc.getIndex() == -1) {
        return UNRECOGNIZED;
      }
      return VALUES[desc.getIndex()];
    }

    private final int value;

    private DeviceType(int value) {
      this.value = value;
    }

    // @@protoc_insertion_point(enum_scope:tensorflow.ProfileOptions.DeviceType)
  }

  public static final int VERSION_FIELD_NUMBER = 5;
  private int version_;
  /**
   * <pre>
   * Some default value of option are not proto3 default value. Use this version
   * to determine if we should use default option value instead of proto3
   * default value.
   * </pre>
   *
   * <code>uint32 version = 5;</code>
   */
  public int getVersion() {
    return version_;
  }

  public static final int DEVICE_TYPE_FIELD_NUMBER = 6;
  private int deviceType_;
  /**
   * <pre>
   * Device type to profile/trace: (version &gt;= 1)
   * DeviceType::UNSPECIFIED: All registered device profiler will be enabled.
   * DeviceType::CPU: only CPU will be profiled.
   * DeviceType::GPU: only CPU/GPU will be profiled.
   * DeviceType::TPU: only CPU/TPU will be profiled.
   * DeviceType::PLUGGABLE_DEVICE: only CPU/pluggable devices with profilers
   * will be profiled.
   * </pre>
   *
   * <code>.tensorflow.ProfileOptions.DeviceType device_type = 6;</code>
   */
  public int getDeviceTypeValue() {
    return deviceType_;
  }
  /**
   * <pre>
   * Device type to profile/trace: (version &gt;= 1)
   * DeviceType::UNSPECIFIED: All registered device profiler will be enabled.
   * DeviceType::CPU: only CPU will be profiled.
   * DeviceType::GPU: only CPU/GPU will be profiled.
   * DeviceType::TPU: only CPU/TPU will be profiled.
   * DeviceType::PLUGGABLE_DEVICE: only CPU/pluggable devices with profilers
   * will be profiled.
   * </pre>
   *
   * <code>.tensorflow.ProfileOptions.DeviceType device_type = 6;</code>
   */
  public org.tensorflow.proto.profiler.ProfileOptions.DeviceType getDeviceType() {
    @SuppressWarnings("deprecation")
    org.tensorflow.proto.profiler.ProfileOptions.DeviceType result = org.tensorflow.proto.profiler.ProfileOptions.DeviceType.valueOf(deviceType_);
    return result == null ? org.tensorflow.proto.profiler.ProfileOptions.DeviceType.UNRECOGNIZED : result;
  }

  public static final int INCLUDE_DATASET_OPS_FIELD_NUMBER = 1;
  private boolean includeDatasetOps_;
  /**
   * <pre>
   * We don't collect the dataset ops by default for better trace-viewer
   * scalability. The caller can mannually set this field to include the ops.
   * </pre>
   *
   * <code>bool include_dataset_ops = 1;</code>
   */
  public boolean getIncludeDatasetOps() {
    return includeDatasetOps_;
  }

  public static final int HOST_TRACER_LEVEL_FIELD_NUMBER = 2;
  private int hostTracerLevel_;
  /**
   * <pre>
   * Levels of host tracing: (version &gt;= 1)
   * - Level 0 is used to disable host traces.
   * - Level 1 enables tracing of only user instrumented (or default) TraceMe.
   * - Level 2 enables tracing of all level 1 TraceMe(s) and instrumented high
   *           level program execution details (expensive TF ops, XLA ops, etc).
   *           This is the default.
   * - Level 3 enables tracing of all level 2 TraceMe(s) and more verbose
   *           (low-level) program execution details (cheap TF ops, etc).
   * </pre>
   *
   * <code>uint32 host_tracer_level = 2;</code>
   */
  public int getHostTracerLevel() {
    return hostTracerLevel_;
  }

  public static final int DEVICE_TRACER_LEVEL_FIELD_NUMBER = 3;
  private int deviceTracerLevel_;
  /**
   * <pre>
   * Levels of device tracing: (version &gt;= 1)
   * - Level 0 is used to disable device traces.
   * - Level 1 is used to enable device traces.
   * - More levels might be defined for specific device for controlling the
   *   verbosity of the trace.
   * </pre>
   *
   * <code>uint32 device_tracer_level = 3;</code>
   */
  public int getDeviceTracerLevel() {
    return deviceTracerLevel_;
  }

  public static final int PYTHON_TRACER_LEVEL_FIELD_NUMBER = 4;
  private int pythonTracerLevel_;
  /**
   * <pre>
   * Whether enable python function calls tracing. Runtime overhead ensues if
   * enabled. Default off. (version &gt;= 1)
   * </pre>
   *
   * <code>uint32 python_tracer_level = 4;</code>
   */
  public int getPythonTracerLevel() {
    return pythonTracerLevel_;
  }

  public static final int ENABLE_HLO_PROTO_FIELD_NUMBER = 7;
  private boolean enableHloProto_;
  /**
   * <pre>
   * Whether serialize hlo_proto when XLA is used. (version &gt;= 1)
   * </pre>
   *
   * <code>bool enable_hlo_proto = 7;</code>
   */
  public boolean getEnableHloProto() {
    return enableHloProto_;
  }

  public static final int START_TIMESTAMP_NS_FIELD_NUMBER = 8;
  private long startTimestampNs_;
  /**
   * <pre>
   * The local profiler starts profiling at this Unix timestamp in nanoseconds.
   * </pre>
   *
   * <code>uint64 start_timestamp_ns = 8;</code>
   */
  public long getStartTimestampNs() {
    return startTimestampNs_;
  }

  public static final int DURATION_MS_FIELD_NUMBER = 9;
  private long durationMs_;
  /**
   * <pre>
   * The local profiler collects `duration_ms` milliseconds of data. If the
   * value is 0, profiling continues until interrupted.
   * </pre>
   *
   * <code>uint64 duration_ms = 9;</code>
   */
  public long getDurationMs() {
    return durationMs_;
  }

  public static final int REPOSITORY_PATH_FIELD_NUMBER = 10;
  private volatile java.lang.Object repositoryPath_;
  /**
   * <pre>
   * Directory to save profile data to. No-op when empty.
   * </pre>
   *
   * <code>string repository_path = 10;</code>
   */
  public java.lang.String getRepositoryPath() {
    java.lang.Object ref = repositoryPath_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      repositoryPath_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * Directory to save profile data to. No-op when empty.
   * </pre>
   *
   * <code>string repository_path = 10;</code>
   */
  public com.google.protobuf.ByteString
      getRepositoryPathBytes() {
    java.lang.Object ref = repositoryPath_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      repositoryPath_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  private byte memoizedIsInitialized = -1;
  @java.lang.Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output)
                      throws java.io.IOException {
    if (includeDatasetOps_ != false) {
      output.writeBool(1, includeDatasetOps_);
    }
    if (hostTracerLevel_ != 0) {
      output.writeUInt32(2, hostTracerLevel_);
    }
    if (deviceTracerLevel_ != 0) {
      output.writeUInt32(3, deviceTracerLevel_);
    }
    if (pythonTracerLevel_ != 0) {
      output.writeUInt32(4, pythonTracerLevel_);
    }
    if (version_ != 0) {
      output.writeUInt32(5, version_);
    }
    if (deviceType_ != org.tensorflow.proto.profiler.ProfileOptions.DeviceType.UNSPECIFIED.getNumber()) {
      output.writeEnum(6, deviceType_);
    }
    if (enableHloProto_ != false) {
      output.writeBool(7, enableHloProto_);
    }
    if (startTimestampNs_ != 0L) {
      output.writeUInt64(8, startTimestampNs_);
    }
    if (durationMs_ != 0L) {
      output.writeUInt64(9, durationMs_);
    }
    if (!getRepositoryPathBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 10, repositoryPath_);
    }
    unknownFields.writeTo(output);
  }

  @java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (includeDatasetOps_ != false) {
      size += com.google.protobuf.CodedOutputStream
        .computeBoolSize(1, includeDatasetOps_);
    }
    if (hostTracerLevel_ != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeUInt32Size(2, hostTracerLevel_);
    }
    if (deviceTracerLevel_ != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeUInt32Size(3, deviceTracerLevel_);
    }
    if (pythonTracerLevel_ != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeUInt32Size(4, pythonTracerLevel_);
    }
    if (version_ != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeUInt32Size(5, version_);
    }
    if (deviceType_ != org.tensorflow.proto.profiler.ProfileOptions.DeviceType.UNSPECIFIED.getNumber()) {
      size += com.google.protobuf.CodedOutputStream
        .computeEnumSize(6, deviceType_);
    }
    if (enableHloProto_ != false) {
      size += com.google.protobuf.CodedOutputStream
        .computeBoolSize(7, enableHloProto_);
    }
    if (startTimestampNs_ != 0L) {
      size += com.google.protobuf.CodedOutputStream
        .computeUInt64Size(8, startTimestampNs_);
    }
    if (durationMs_ != 0L) {
      size += com.google.protobuf.CodedOutputStream
        .computeUInt64Size(9, durationMs_);
    }
    if (!getRepositoryPathBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, repositoryPath_);
    }
    size += unknownFields.getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
     return true;
    }
    if (!(obj instanceof org.tensorflow.proto.profiler.ProfileOptions)) {
      return super.equals(obj);
    }
    org.tensorflow.proto.profiler.ProfileOptions other = (org.tensorflow.proto.profiler.ProfileOptions) obj;

    if (getVersion()
        != other.getVersion()) return false;
    if (deviceType_ != other.deviceType_) return false;
    if (getIncludeDatasetOps()
        != other.getIncludeDatasetOps()) return false;
    if (getHostTracerLevel()
        != other.getHostTracerLevel()) return false;
    if (getDeviceTracerLevel()
        != other.getDeviceTracerLevel()) return false;
    if (getPythonTracerLevel()
        != other.getPythonTracerLevel()) return false;
    if (getEnableHloProto()
        != other.getEnableHloProto()) return false;
    if (getStartTimestampNs()
        != other.getStartTimestampNs()) return false;
    if (getDurationMs()
        != other.getDurationMs()) return false;
    if (!getRepositoryPath()
        .equals(other.getRepositoryPath())) return false;
    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + VERSION_FIELD_NUMBER;
    hash = (53 * hash) + getVersion();
    hash = (37 * hash) + DEVICE_TYPE_FIELD_NUMBER;
    hash = (53 * hash) + deviceType_;
    hash = (37 * hash) + INCLUDE_DATASET_OPS_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
        getIncludeDatasetOps());
    hash = (37 * hash) + HOST_TRACER_LEVEL_FIELD_NUMBER;
    hash = (53 * hash) + getHostTracerLevel();
    hash = (37 * hash) + DEVICE_TRACER_LEVEL_FIELD_NUMBER;
    hash = (53 * hash) + getDeviceTracerLevel();
    hash = (37 * hash) + PYTHON_TRACER_LEVEL_FIELD_NUMBER;
    hash = (53 * hash) + getPythonTracerLevel();
    hash = (37 * hash) + ENABLE_HLO_PROTO_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
        getEnableHloProto());
    hash = (37 * hash) + START_TIMESTAMP_NS_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
        getStartTimestampNs());
    hash = (37 * hash) + DURATION_MS_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
        getDurationMs());
    hash = (37 * hash) + REPOSITORY_PATH_FIELD_NUMBER;
    hash = (53 * hash) + getRepositoryPath().hashCode();
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static org.tensorflow.proto.profiler.ProfileOptions parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.tensorflow.proto.profiler.ProfileOptions parseFrom(
      java.nio.ByteBuffer data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static org.tensorflow.proto.profiler.ProfileOptions parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.tensorflow.proto.profiler.ProfileOptions parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static org.tensorflow.proto.profiler.ProfileOptions parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.tensorflow.proto.profiler.ProfileOptions parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static org.tensorflow.proto.profiler.ProfileOptions parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static org.tensorflow.proto.profiler.ProfileOptions parseFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }
  public static org.tensorflow.proto.profiler.ProfileOptions parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static org.tensorflow.proto.profiler.ProfileOptions parseDelimitedFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
  }
  public static org.tensorflow.proto.profiler.ProfileOptions parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static org.tensorflow.proto.profiler.ProfileOptions parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }

  @java.lang.Override
  public Builder newBuilderForType() { return newBuilder(); }
  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }
  public static Builder newBuilder(org.tensorflow.proto.profiler.ProfileOptions prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }
  @java.lang.Override
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE
        ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(
      com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   * <pre>
   * Next ID: 11
   * </pre>
   *
   * Protobuf type {@code tensorflow.ProfileOptions}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:tensorflow.ProfileOptions)
      org.tensorflow.proto.profiler.ProfileOptionsOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return org.tensorflow.proto.profiler.ProfilerOptionsProtos.internal_static_tensorflow_ProfileOptions_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return org.tensorflow.proto.profiler.ProfilerOptionsProtos.internal_static_tensorflow_ProfileOptions_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              org.tensorflow.proto.profiler.ProfileOptions.class, org.tensorflow.proto.profiler.ProfileOptions.Builder.class);
    }

    // Construct using org.tensorflow.proto.profiler.ProfileOptions.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }
    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3
              .alwaysUseFieldBuilders) {
      }
    }
    @java.lang.Override
    public Builder clear() {
      super.clear();
      version_ = 0;

      deviceType_ = 0;

      includeDatasetOps_ = false;

      hostTracerLevel_ = 0;

      deviceTracerLevel_ = 0;

      pythonTracerLevel_ = 0;

      enableHloProto_ = false;

      startTimestampNs_ = 0L;

      durationMs_ = 0L;

      repositoryPath_ = "";

      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return org.tensorflow.proto.profiler.ProfilerOptionsProtos.internal_static_tensorflow_ProfileOptions_descriptor;
    }

    @java.lang.Override
    public org.tensorflow.proto.profiler.ProfileOptions getDefaultInstanceForType() {
      return org.tensorflow.proto.profiler.ProfileOptions.getDefaultInstance();
    }

    @java.lang.Override
    public org.tensorflow.proto.profiler.ProfileOptions build() {
      org.tensorflow.proto.profiler.ProfileOptions result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public org.tensorflow.proto.profiler.ProfileOptions buildPartial() {
      org.tensorflow.proto.profiler.ProfileOptions result = new org.tensorflow.proto.profiler.ProfileOptions(this);
      result.version_ = version_;
      result.deviceType_ = deviceType_;
      result.includeDatasetOps_ = includeDatasetOps_;
      result.hostTracerLevel_ = hostTracerLevel_;
      result.deviceTracerLevel_ = deviceTracerLevel_;
      result.pythonTracerLevel_ = pythonTracerLevel_;
      result.enableHloProto_ = enableHloProto_;
      result.startTimestampNs_ = startTimestampNs_;
      result.durationMs_ = durationMs_;
      result.repositoryPath_ = repositoryPath_;
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }
    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return super.setField(field, value);
    }
    @java.lang.Override
    public Builder clearField(
        com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }
    @java.lang.Override
    public Builder clearOneof(
        com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }
    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }
    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }
    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof org.tensorflow.proto.profiler.ProfileOptions) {
        return mergeFrom((org.tensorflow.proto.profiler.ProfileOptions)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(org.tensorflow.proto.profiler.ProfileOptions other) {
      if (other == org.tensorflow.proto.profiler.ProfileOptions.getDefaultInstance()) return this;
      if (other.getVersion() != 0) {
        setVersion(other.getVersion());
      }
      if (other.deviceType_ != 0) {
        setDeviceTypeValue(other.getDeviceTypeValue());
      }
      if (other.getIncludeDatasetOps() != false) {
        setIncludeDatasetOps(other.getIncludeDatasetOps());
      }
      if (other.getHostTracerLevel() != 0) {
        setHostTracerLevel(other.getHostTracerLevel());
      }
      if (other.getDeviceTracerLevel() != 0) {
        setDeviceTracerLevel(other.getDeviceTracerLevel());
      }
      if (other.getPythonTracerLevel() != 0) {
        setPythonTracerLevel(other.getPythonTracerLevel());
      }
      if (other.getEnableHloProto() != false) {
        setEnableHloProto(other.getEnableHloProto());
      }
      if (other.getStartTimestampNs() != 0L) {
        setStartTimestampNs(other.getStartTimestampNs());
      }
      if (other.getDurationMs() != 0L) {
        setDurationMs(other.getDurationMs());
      }
      if (!other.getRepositoryPath().isEmpty()) {
        repositoryPath_ = other.repositoryPath_;
        onChanged();
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

    @java.lang.Override
    public final boolean isInitialized() {
      return true;
    }

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      org.tensorflow.proto.profiler.ProfileOptions parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (org.tensorflow.proto.profiler.ProfileOptions) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private int version_ ;
    /**
     * <pre>
     * Some default value of option are not proto3 default value. Use this version
     * to determine if we should use default option value instead of proto3
     * default value.
     * </pre>
     *
     * <code>uint32 version = 5;</code>
     */
    public int getVersion() {
      return version_;
    }
    /**
     * <pre>
     * Some default value of option are not proto3 default value. Use this version
     * to determine if we should use default option value instead of proto3
     * default value.
     * </pre>
     *
     * <code>uint32 version = 5;</code>
     */
    public Builder setVersion(int value) {
      
      version_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Some default value of option are not proto3 default value. Use this version
     * to determine if we should use default option value instead of proto3
     * default value.
     * </pre>
     *
     * <code>uint32 version = 5;</code>
     */
    public Builder clearVersion() {
      
      version_ = 0;
      onChanged();
      return this;
    }

    private int deviceType_ = 0;
    /**
     * <pre>
     * Device type to profile/trace: (version &gt;= 1)
     * DeviceType::UNSPECIFIED: All registered device profiler will be enabled.
     * DeviceType::CPU: only CPU will be profiled.
     * DeviceType::GPU: only CPU/GPU will be profiled.
     * DeviceType::TPU: only CPU/TPU will be profiled.
     * DeviceType::PLUGGABLE_DEVICE: only CPU/pluggable devices with profilers
     * will be profiled.
     * </pre>
     *
     * <code>.tensorflow.ProfileOptions.DeviceType device_type = 6;</code>
     */
    public int getDeviceTypeValue() {
      return deviceType_;
    }
    /**
     * <pre>
     * Device type to profile/trace: (version &gt;= 1)
     * DeviceType::UNSPECIFIED: All registered device profiler will be enabled.
     * DeviceType::CPU: only CPU will be profiled.
     * DeviceType::GPU: only CPU/GPU will be profiled.
     * DeviceType::TPU: only CPU/TPU will be profiled.
     * DeviceType::PLUGGABLE_DEVICE: only CPU/pluggable devices with profilers
     * will be profiled.
     * </pre>
     *
     * <code>.tensorflow.ProfileOptions.DeviceType device_type = 6;</code>
     */
    public Builder setDeviceTypeValue(int value) {
      deviceType_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Device type to profile/trace: (version &gt;= 1)
     * DeviceType::UNSPECIFIED: All registered device profiler will be enabled.
     * DeviceType::CPU: only CPU will be profiled.
     * DeviceType::GPU: only CPU/GPU will be profiled.
     * DeviceType::TPU: only CPU/TPU will be profiled.
     * DeviceType::PLUGGABLE_DEVICE: only CPU/pluggable devices with profilers
     * will be profiled.
     * </pre>
     *
     * <code>.tensorflow.ProfileOptions.DeviceType device_type = 6;</code>
     */
    public org.tensorflow.proto.profiler.ProfileOptions.DeviceType getDeviceType() {
      @SuppressWarnings("deprecation")
      org.tensorflow.proto.profiler.ProfileOptions.DeviceType result = org.tensorflow.proto.profiler.ProfileOptions.DeviceType.valueOf(deviceType_);
      return result == null ? org.tensorflow.proto.profiler.ProfileOptions.DeviceType.UNRECOGNIZED : result;
    }
    /**
     * <pre>
     * Device type to profile/trace: (version &gt;= 1)
     * DeviceType::UNSPECIFIED: All registered device profiler will be enabled.
     * DeviceType::CPU: only CPU will be profiled.
     * DeviceType::GPU: only CPU/GPU will be profiled.
     * DeviceType::TPU: only CPU/TPU will be profiled.
     * DeviceType::PLUGGABLE_DEVICE: only CPU/pluggable devices with profilers
     * will be profiled.
     * </pre>
     *
     * <code>.tensorflow.ProfileOptions.DeviceType device_type = 6;</code>
     */
    public Builder setDeviceType(org.tensorflow.proto.profiler.ProfileOptions.DeviceType value) {
      if (value == null) {
        throw new NullPointerException();
      }
      
      deviceType_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Device type to profile/trace: (version &gt;= 1)
     * DeviceType::UNSPECIFIED: All registered device profiler will be enabled.
     * DeviceType::CPU: only CPU will be profiled.
     * DeviceType::GPU: only CPU/GPU will be profiled.
     * DeviceType::TPU: only CPU/TPU will be profiled.
     * DeviceType::PLUGGABLE_DEVICE: only CPU/pluggable devices with profilers
     * will be profiled.
     * </pre>
     *
     * <code>.tensorflow.ProfileOptions.DeviceType device_type = 6;</code>
     */
    public Builder clearDeviceType() {
      
      deviceType_ = 0;
      onChanged();
      return this;
    }

    private boolean includeDatasetOps_ ;
    /**
     * <pre>
     * We don't collect the dataset ops by default for better trace-viewer
     * scalability. The caller can mannually set this field to include the ops.
     * </pre>
     *
     * <code>bool include_dataset_ops = 1;</code>
     */
    public boolean getIncludeDatasetOps() {
      return includeDatasetOps_;
    }
    /**
     * <pre>
     * We don't collect the dataset ops by default for better trace-viewer
     * scalability. The caller can mannually set this field to include the ops.
     * </pre>
     *
     * <code>bool include_dataset_ops = 1;</code>
     */
    public Builder setIncludeDatasetOps(boolean value) {
      
      includeDatasetOps_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * We don't collect the dataset ops by default for better trace-viewer
     * scalability. The caller can mannually set this field to include the ops.
     * </pre>
     *
     * <code>bool include_dataset_ops = 1;</code>
     */
    public Builder clearIncludeDatasetOps() {
      
      includeDatasetOps_ = false;
      onChanged();
      return this;
    }

    private int hostTracerLevel_ ;
    /**
     * <pre>
     * Levels of host tracing: (version &gt;= 1)
     * - Level 0 is used to disable host traces.
     * - Level 1 enables tracing of only user instrumented (or default) TraceMe.
     * - Level 2 enables tracing of all level 1 TraceMe(s) and instrumented high
     *           level program execution details (expensive TF ops, XLA ops, etc).
     *           This is the default.
     * - Level 3 enables tracing of all level 2 TraceMe(s) and more verbose
     *           (low-level) program execution details (cheap TF ops, etc).
     * </pre>
     *
     * <code>uint32 host_tracer_level = 2;</code>
     */
    public int getHostTracerLevel() {
      return hostTracerLevel_;
    }
    /**
     * <pre>
     * Levels of host tracing: (version &gt;= 1)
     * - Level 0 is used to disable host traces.
     * - Level 1 enables tracing of only user instrumented (or default) TraceMe.
     * - Level 2 enables tracing of all level 1 TraceMe(s) and instrumented high
     *           level program execution details (expensive TF ops, XLA ops, etc).
     *           This is the default.
     * - Level 3 enables tracing of all level 2 TraceMe(s) and more verbose
     *           (low-level) program execution details (cheap TF ops, etc).
     * </pre>
     *
     * <code>uint32 host_tracer_level = 2;</code>
     */
    public Builder setHostTracerLevel(int value) {
      
      hostTracerLevel_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Levels of host tracing: (version &gt;= 1)
     * - Level 0 is used to disable host traces.
     * - Level 1 enables tracing of only user instrumented (or default) TraceMe.
     * - Level 2 enables tracing of all level 1 TraceMe(s) and instrumented high
     *           level program execution details (expensive TF ops, XLA ops, etc).
     *           This is the default.
     * - Level 3 enables tracing of all level 2 TraceMe(s) and more verbose
     *           (low-level) program execution details (cheap TF ops, etc).
     * </pre>
     *
     * <code>uint32 host_tracer_level = 2;</code>
     */
    public Builder clearHostTracerLevel() {
      
      hostTracerLevel_ = 0;
      onChanged();
      return this;
    }

    private int deviceTracerLevel_ ;
    /**
     * <pre>
     * Levels of device tracing: (version &gt;= 1)
     * - Level 0 is used to disable device traces.
     * - Level 1 is used to enable device traces.
     * - More levels might be defined for specific device for controlling the
     *   verbosity of the trace.
     * </pre>
     *
     * <code>uint32 device_tracer_level = 3;</code>
     */
    public int getDeviceTracerLevel() {
      return deviceTracerLevel_;
    }
    /**
     * <pre>
     * Levels of device tracing: (version &gt;= 1)
     * - Level 0 is used to disable device traces.
     * - Level 1 is used to enable device traces.
     * - More levels might be defined for specific device for controlling the
     *   verbosity of the trace.
     * </pre>
     *
     * <code>uint32 device_tracer_level = 3;</code>
     */
    public Builder setDeviceTracerLevel(int value) {
      
      deviceTracerLevel_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Levels of device tracing: (version &gt;= 1)
     * - Level 0 is used to disable device traces.
     * - Level 1 is used to enable device traces.
     * - More levels might be defined for specific device for controlling the
     *   verbosity of the trace.
     * </pre>
     *
     * <code>uint32 device_tracer_level = 3;</code>
     */
    public Builder clearDeviceTracerLevel() {
      
      deviceTracerLevel_ = 0;
      onChanged();
      return this;
    }

    private int pythonTracerLevel_ ;
    /**
     * <pre>
     * Whether enable python function calls tracing. Runtime overhead ensues if
     * enabled. Default off. (version &gt;= 1)
     * </pre>
     *
     * <code>uint32 python_tracer_level = 4;</code>
     */
    public int getPythonTracerLevel() {
      return pythonTracerLevel_;
    }
    /**
     * <pre>
     * Whether enable python function calls tracing. Runtime overhead ensues if
     * enabled. Default off. (version &gt;= 1)
     * </pre>
     *
     * <code>uint32 python_tracer_level = 4;</code>
     */
    public Builder setPythonTracerLevel(int value) {
      
      pythonTracerLevel_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Whether enable python function calls tracing. Runtime overhead ensues if
     * enabled. Default off. (version &gt;= 1)
     * </pre>
     *
     * <code>uint32 python_tracer_level = 4;</code>
     */
    public Builder clearPythonTracerLevel() {
      
      pythonTracerLevel_ = 0;
      onChanged();
      return this;
    }

    private boolean enableHloProto_ ;
    /**
     * <pre>
     * Whether serialize hlo_proto when XLA is used. (version &gt;= 1)
     * </pre>
     *
     * <code>bool enable_hlo_proto = 7;</code>
     */
    public boolean getEnableHloProto() {
      return enableHloProto_;
    }
    /**
     * <pre>
     * Whether serialize hlo_proto when XLA is used. (version &gt;= 1)
     * </pre>
     *
     * <code>bool enable_hlo_proto = 7;</code>
     */
    public Builder setEnableHloProto(boolean value) {
      
      enableHloProto_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Whether serialize hlo_proto when XLA is used. (version &gt;= 1)
     * </pre>
     *
     * <code>bool enable_hlo_proto = 7;</code>
     */
    public Builder clearEnableHloProto() {
      
      enableHloProto_ = false;
      onChanged();
      return this;
    }

    private long startTimestampNs_ ;
    /**
     * <pre>
     * The local profiler starts profiling at this Unix timestamp in nanoseconds.
     * </pre>
     *
     * <code>uint64 start_timestamp_ns = 8;</code>
     */
    public long getStartTimestampNs() {
      return startTimestampNs_;
    }
    /**
     * <pre>
     * The local profiler starts profiling at this Unix timestamp in nanoseconds.
     * </pre>
     *
     * <code>uint64 start_timestamp_ns = 8;</code>
     */
    public Builder setStartTimestampNs(long value) {
      
      startTimestampNs_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The local profiler starts profiling at this Unix timestamp in nanoseconds.
     * </pre>
     *
     * <code>uint64 start_timestamp_ns = 8;</code>
     */
    public Builder clearStartTimestampNs() {
      
      startTimestampNs_ = 0L;
      onChanged();
      return this;
    }

    private long durationMs_ ;
    /**
     * <pre>
     * The local profiler collects `duration_ms` milliseconds of data. If the
     * value is 0, profiling continues until interrupted.
     * </pre>
     *
     * <code>uint64 duration_ms = 9;</code>
     */
    public long getDurationMs() {
      return durationMs_;
    }
    /**
     * <pre>
     * The local profiler collects `duration_ms` milliseconds of data. If the
     * value is 0, profiling continues until interrupted.
     * </pre>
     *
     * <code>uint64 duration_ms = 9;</code>
     */
    public Builder setDurationMs(long value) {
      
      durationMs_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The local profiler collects `duration_ms` milliseconds of data. If the
     * value is 0, profiling continues until interrupted.
     * </pre>
     *
     * <code>uint64 duration_ms = 9;</code>
     */
    public Builder clearDurationMs() {
      
      durationMs_ = 0L;
      onChanged();
      return this;
    }

    private java.lang.Object repositoryPath_ = "";
    /**
     * <pre>
     * Directory to save profile data to. No-op when empty.
     * </pre>
     *
     * <code>string repository_path = 10;</code>
     */
    public java.lang.String getRepositoryPath() {
      java.lang.Object ref = repositoryPath_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        repositoryPath_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * Directory to save profile data to. No-op when empty.
     * </pre>
     *
     * <code>string repository_path = 10;</code>
     */
    public com.google.protobuf.ByteString
        getRepositoryPathBytes() {
      java.lang.Object ref = repositoryPath_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        repositoryPath_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * Directory to save profile data to. No-op when empty.
     * </pre>
     *
     * <code>string repository_path = 10;</code>
     */
    public Builder setRepositoryPath(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      repositoryPath_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Directory to save profile data to. No-op when empty.
     * </pre>
     *
     * <code>string repository_path = 10;</code>
     */
    public Builder clearRepositoryPath() {
      
      repositoryPath_ = getDefaultInstance().getRepositoryPath();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Directory to save profile data to. No-op when empty.
     * </pre>
     *
     * <code>string repository_path = 10;</code>
     */
    public Builder setRepositoryPathBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      repositoryPath_ = value;
      onChanged();
      return this;
    }
    @java.lang.Override
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

    @java.lang.Override
    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.mergeUnknownFields(unknownFields);
    }


    // @@protoc_insertion_point(builder_scope:tensorflow.ProfileOptions)
  }

  // @@protoc_insertion_point(class_scope:tensorflow.ProfileOptions)
  private static final org.tensorflow.proto.profiler.ProfileOptions DEFAULT_INSTANCE;
  static {
    DEFAULT_INSTANCE = new org.tensorflow.proto.profiler.ProfileOptions();
  }

  public static org.tensorflow.proto.profiler.ProfileOptions getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

  private static final com.google.protobuf.Parser<ProfileOptions>
      PARSER = new com.google.protobuf.AbstractParser<ProfileOptions>() {
    @java.lang.Override
    public ProfileOptions parsePartialFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return new ProfileOptions(input, extensionRegistry);
    }
  };

  public static com.google.protobuf.Parser<ProfileOptions> parser() {
    return PARSER;
  }

  @java.lang.Override
  public com.google.protobuf.Parser<ProfileOptions> getParserForType() {
    return PARSER;
  }

  @java.lang.Override
  public org.tensorflow.proto.profiler.ProfileOptions getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}

