chromium/third_party/tflite/src/tensorflow/lite/core/async/task_internal.h

/* 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.
==============================================================================*/
#ifndef TENSORFLOW_LITE_CORE_ASYNC_TASK_INTERNAL_H_
#define TENSORFLOW_LITE_CORE_ASYNC_TASK_INTERNAL_H_

#include <atomic>
#include <map>
#include <memory>
#include <string>

#include "tensorflow/lite/core/async/async_kernel_internal.h"
#include "tensorflow/lite/core/async/c/types.h"
#include "tensorflow/lite/core/async/interop/c/types.h"
#include "tensorflow/lite/core/c/c_api_types.h"
#include "tensorflow/lite/core/c/common.h"

// Forward declaration
namespace tflite::async {
class ExecutionTask;
}  // namespace tflite::async

// TfLiteExecutionTask object holds the mapping from tensor index to
// the backend buffer and sync object tied to that tensor.
// It also holds the event handle that represents a specific scheduled
// async execution.
// The AsyncSignatureRunner that creates the task should out-live the life time
// of the TfLiteExecutionTask.
struct TfLiteExecutionTask {};

namespace tflite {
namespace async {

// Implementation of TfLiteExecutionTask.
// This class is not thread safe.
class ExecutionTask {};

}  // namespace async
}  // namespace tflite

#endif  // TENSORFLOW_LITE_CORE_ASYNC_TASK_INTERNAL_H_