// Copyright 2020 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.

include "tensorflow/lite/delegates/gpu/common/task/serialization_base.fbs";

namespace tflite.gpu.cl.data;

table TensorDescWithId {
  desc:tflite.gpu.data.TensorDescriptor;
  id:int32;
}

table CLNode {
  gpu_op:tflite.gpu.data.GPUOperation;
  input_ids:[int32];
  output_ids:[int32];
  name:string;
}

table PairOfValueIds {
  first:int32;
  second:int32;
}

table InferenceContext {
  need_flush:bool;
  flush_periodically:bool;
  flush_period:int32;
  need_manual_release:bool;
  precision:tflite.gpu.data.CalculationsPrecision;
  storage_type:tflite.gpu.data.TensorStorageType;
  nodes:[CLNode];
  tensors:[TensorDescWithId];
  const_tensors:[TensorDescWithId];
  input_ids:[int32];
  variable_ids_and_refs:[PairOfValueIds];
  output_ids:[int32];
  input_refs:[int64];
  output_refs:[int64];
}

root_type InferenceContext;
