/* Copyright 2022 The TensorFlow Authors. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/

syntax = "proto3";

package stream_executor;

import "tensorflow/compiler/xla/autotune_results.proto";

message CudaComputeCapabilityProto {
  int32 major = 1;
  int32 minor = 2;
}

message RocmComputeCapabilityProto {
  string gcn_arch_name = 1;
}

message GpuDeviceInfoProto {
  int32 threads_per_block_limit = 1;
  int32 threads_per_warp = 2;
  int32 shared_memory_per_block = 3;
  int32 shared_memory_per_core = 4;
  int32 threads_per_core_limit = 5;
  int32 core_count = 6;
  int64 fpus_per_core = 7;
  int32 block_dim_limit_x = 8;
  int32 block_dim_limit_y = 9;
  int32 block_dim_limit_z = 10;
  int64 memory_bandwidth = 11;
  int64 l2_cache_size = 12;
  float clock_rate_ghz = 13;
  int64 device_memory_size = 14;
  int32 shared_memory_per_block_optin = 15;
}

message DnnVersionInfoProto {
  int32 major = 1;
  int32 minor = 2;
  int32 patch = 3;
}

message GpuTargetConfigProto {
  GpuDeviceInfoProto gpu_device_info = 1;
  oneof compute_capability {
    CudaComputeCapabilityProto cuda_compute_capability = 2;
    RocmComputeCapabilityProto rocm_compute_capability = 3;
  }
  string platform_name = 4;
  DnnVersionInfoProto dnn_version_info = 5;

  // TODO(b/248362914): Autotuning results should be separate from
  // GpuTargetConfig because autotuning can be updated regularly separate from
  // the target.
  xla.AutotuneResults autotune_results = 6;

  string device_description_str = 7;
}
