#ifndef COMPONENTS_ML_MOJOM_WEB_PLATFORM_MODEL_MOJOM_SHARED_H_
#define COMPONENTS_ML_MOJOM_WEB_PLATFORM_MODEL_MOJOM_SHARED_H_
#include <stdint.h>
#include <functional>
#include <iosfwd>
#include <type_traits>
#include <utility>
#include "mojo/public/cpp/bindings/array_data_view.h"
#include "mojo/public/cpp/bindings/enum_traits.h"
#include "mojo/public/cpp/bindings/interface_data_view.h"
#include "mojo/public/cpp/bindings/lib/bindings_internal.h"
#include "mojo/public/cpp/bindings/lib/serialization.h"
#include "mojo/public/cpp/bindings/map_data_view.h"
#include "mojo/public/cpp/bindings/string_data_view.h"
#include "third_party/perfetto/include/perfetto/tracing/traced_value_forward.h"
#include "components/ml/mojom/web_platform_model.mojom-shared-internal.h"
#include "mojo/public/mojom/base/big_buffer.mojom-shared.h"
#include "mojo/public/cpp/bindings/lib/interface_serialization.h"
#include "mojo/public/cpp/system/data_pipe.h"
namespace ml::model_loader::mojom {
class CreateModelLoaderOptionsDataView;
class TensorInfoDataView;
class ModelInfoDataView;
}
namespace mojo {
namespace internal {
template <>
struct MojomTypeTraits<::ml::model_loader::mojom::CreateModelLoaderOptionsDataView> { … };
template <>
struct MojomTypeTraits<::ml::model_loader::mojom::TensorInfoDataView> { … };
template <>
struct MojomTypeTraits<::ml::model_loader::mojom::ModelInfoDataView> { … };
}
}
namespace ml::model_loader::mojom {
enum class ModelFormat : int32_t { … };
std::ostream& operator<<(std::ostream& os, ModelFormat value);
inline bool IsKnownEnumValue(ModelFormat value) { … }
inline ModelFormat ToKnownEnumValue(ModelFormat value) { … }
enum class DevicePreference : int32_t { … };
std::ostream& operator<<(std::ostream& os, DevicePreference value);
inline bool IsKnownEnumValue(DevicePreference value) { … }
inline DevicePreference ToKnownEnumValue(DevicePreference value) { … }
enum class DataType : int32_t { … };
std::ostream& operator<<(std::ostream& os, DataType value);
inline bool IsKnownEnumValue(DataType value) { … }
inline DataType ToKnownEnumValue(DataType value) { … }
enum class LoadModelResult : int32_t { … };
std::ostream& operator<<(std::ostream& os, LoadModelResult value);
inline bool IsKnownEnumValue(LoadModelResult value) { … }
enum class CreateModelLoaderResult : int32_t { … };
std::ostream& operator<<(std::ostream& os, CreateModelLoaderResult value);
inline bool IsKnownEnumValue(CreateModelLoaderResult value) { … }
enum class ComputeResult : int32_t { … };
std::ostream& operator<<(std::ostream& os, ComputeResult value);
inline bool IsKnownEnumValue(ComputeResult value) { … }
class ModelLoaderInterfaceBase { … };
ModelLoaderPtrDataView;
ModelLoaderRequestDataView;
ModelLoaderAssociatedPtrInfoDataView;
ModelLoaderAssociatedRequestDataView;
class ModelInterfaceBase { … };
ModelPtrDataView;
ModelRequestDataView;
ModelAssociatedPtrInfoDataView;
ModelAssociatedRequestDataView;
class CreateModelLoaderOptionsDataView { … };
class TensorInfoDataView { … };
class ModelInfoDataView { … };
}
namespace std {
template <>
struct hash<::ml::model_loader::mojom::ModelFormat>
: public mojo::internal::EnumHashImpl<::ml::model_loader::mojom::ModelFormat> { … };
template <>
struct hash<::ml::model_loader::mojom::DevicePreference>
: public mojo::internal::EnumHashImpl<::ml::model_loader::mojom::DevicePreference> { … };
template <>
struct hash<::ml::model_loader::mojom::DataType>
: public mojo::internal::EnumHashImpl<::ml::model_loader::mojom::DataType> { … };
template <>
struct hash<::ml::model_loader::mojom::LoadModelResult>
: public mojo::internal::EnumHashImpl<::ml::model_loader::mojom::LoadModelResult> { … };
template <>
struct hash<::ml::model_loader::mojom::CreateModelLoaderResult>
: public mojo::internal::EnumHashImpl<::ml::model_loader::mojom::CreateModelLoaderResult> { … };
template <>
struct hash<::ml::model_loader::mojom::ComputeResult>
: public mojo::internal::EnumHashImpl<::ml::model_loader::mojom::ComputeResult> { … };
}
namespace mojo {
namespace internal {
Serializer< ::ml::model_loader::mojom::ModelFormat, MaybeConstUserType>;
}
namespace internal {
Serializer< ::ml::model_loader::mojom::DevicePreference, MaybeConstUserType>;
}
namespace internal {
Serializer< ::ml::model_loader::mojom::DataType, MaybeConstUserType>;
}
namespace internal {
Serializer< ::ml::model_loader::mojom::LoadModelResult, MaybeConstUserType>;
}
namespace internal {
Serializer< ::ml::model_loader::mojom::CreateModelLoaderResult, MaybeConstUserType>;
}
namespace internal {
Serializer< ::ml::model_loader::mojom::ComputeResult, MaybeConstUserType>;
}
namespace internal {
Serializer< ::ml::model_loader::mojom::CreateModelLoaderOptionsDataView, MaybeConstUserType>;
}
namespace internal {
Serializer< ::ml::model_loader::mojom::TensorInfoDataView, MaybeConstUserType>;
}
namespace internal {
Serializer< ::ml::model_loader::mojom::ModelInfoDataView, MaybeConstUserType>;
}
}
namespace ml::model_loader::mojom {
inline void TensorInfoDataView::GetDimensionsDataView(
mojo::ArrayDataView<uint32_t>* output) { … }
inline void ModelInfoDataView::GetInputTensorInfoDataView(
mojo::MapDataView<mojo::StringDataView, TensorInfoDataView>* output) { … }
inline void ModelInfoDataView::GetOutputTensorInfoDataView(
mojo::MapDataView<mojo::StringDataView, TensorInfoDataView>* output) { … }
}
namespace perfetto {
template <>
struct TraceFormatTraits<::ml::model_loader::mojom::ModelFormat> { … };
}
namespace perfetto {
template <>
struct TraceFormatTraits<::ml::model_loader::mojom::DevicePreference> { … };
}
namespace perfetto {
template <>
struct TraceFormatTraits<::ml::model_loader::mojom::DataType> { … };
}
namespace perfetto {
template <>
struct TraceFormatTraits<::ml::model_loader::mojom::LoadModelResult> { … };
}
namespace perfetto {
template <>
struct TraceFormatTraits<::ml::model_loader::mojom::CreateModelLoaderResult> { … };
}
namespace perfetto {
template <>
struct TraceFormatTraits<::ml::model_loader::mojom::ComputeResult> { … };
}
#endif