#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif
#include "services/webnn/public/mojom/webnn_context_properties.mojom.h"
#include <math.h>
#include <stdint.h>
#include <utility>
#include "base/debug/alias.h"
#include "base/hash/md5_constexpr.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/thread_pool/thread_pool_instance.h"
#include "base/trace_event/trace_event.h"
#include "base/trace_event/typed_macros.h"
#include "mojo/public/cpp/bindings/features.h"
#include "mojo/public/cpp/bindings/lib/default_construct_tag_internal.h"
#include "mojo/public/cpp/bindings/lib/generated_code_util.h"
#include "mojo/public/cpp/bindings/lib/message_internal.h"
#include "mojo/public/cpp/bindings/lib/proxy_to_responder.h"
#include "mojo/public/cpp/bindings/lib/send_message_helper.h"
#include "mojo/public/cpp/bindings/lib/serialization_util.h"
#include "mojo/public/cpp/bindings/lib/unserialized_message_context.h"
#include "mojo/public/cpp/bindings/lib/validate_params.h"
#include "mojo/public/cpp/bindings/lib/validation_errors.h"
#include "mojo/public/cpp/bindings/mojo_buildflags.h"
#include "mojo/public/cpp/bindings/urgent_message_scope.h"
#include "mojo/public/interfaces/bindings/interface_control_messages.mojom.h"
#include "third_party/perfetto/include/perfetto/tracing/traced_value.h"
#include "services/webnn/public/mojom/webnn_context_properties.mojom-params-data.h"
#include "services/webnn/public/mojom/webnn_context_properties.mojom-shared-message-ids.h"
#include "services/webnn/public/mojom/webnn_context_properties.mojom-import-headers.h"
#include "services/webnn/public/mojom/webnn_context_properties.mojom-test-utils.h"
namespace webnn::mojom {
SupportedDataTypes::SupportedDataTypes()
: … { … }
SupportedDataTypes::SupportedDataTypes(
bool float32_in,
bool float16_in,
bool int32_in,
bool uint32_in,
bool int64_in,
bool uint64_in,
bool int8_in,
bool uint8_in)
: … { … }
SupportedDataTypes::~SupportedDataTypes() = default;
void SupportedDataTypes::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool SupportedDataTypes::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
DataTypeLimits::DataTypeLimits()
: … { … }
DataTypeLimits::DataTypeLimits(
const ::webnn::SupportedDataTypes& input_in,
const ::webnn::SupportedDataTypes& constant_in,
const ::webnn::SupportedDataTypes& arg_min_max_input_in,
const ::webnn::SupportedDataTypes& arg_min_max_output_in,
const ::webnn::SupportedDataTypes& cast_input_in,
const ::webnn::SupportedDataTypes& clamp_input_in,
const ::webnn::SupportedDataTypes& concat_inputs_in,
const ::webnn::SupportedDataTypes& add_input_in,
const ::webnn::SupportedDataTypes& sub_input_in,
const ::webnn::SupportedDataTypes& mul_input_in,
const ::webnn::SupportedDataTypes& div_input_in,
const ::webnn::SupportedDataTypes& max_input_in,
const ::webnn::SupportedDataTypes& min_input_in,
const ::webnn::SupportedDataTypes& pow_input_in,
const ::webnn::SupportedDataTypes& equal_input_in,
const ::webnn::SupportedDataTypes& greater_input_in,
const ::webnn::SupportedDataTypes& greater_or_equal_input_in,
const ::webnn::SupportedDataTypes& lesser_input_in,
const ::webnn::SupportedDataTypes& lesser_or_equal_input_in,
const ::webnn::SupportedDataTypes& logical_not_input_in,
const ::webnn::SupportedDataTypes& logical_output_in,
const ::webnn::SupportedDataTypes& abs_input_in,
const ::webnn::SupportedDataTypes& ceil_input_in,
const ::webnn::SupportedDataTypes& cos_input_in,
const ::webnn::SupportedDataTypes& erf_input_in,
const ::webnn::SupportedDataTypes& exp_input_in,
const ::webnn::SupportedDataTypes& floor_input_in,
const ::webnn::SupportedDataTypes& identity_input_in,
const ::webnn::SupportedDataTypes& log_input_in,
const ::webnn::SupportedDataTypes& neg_input_in,
const ::webnn::SupportedDataTypes& reciprocal_input_in,
const ::webnn::SupportedDataTypes& sign_input_in,
const ::webnn::SupportedDataTypes& sin_input_in,
const ::webnn::SupportedDataTypes& sqrt_input_in,
const ::webnn::SupportedDataTypes& tan_input_in,
const ::webnn::SupportedDataTypes& elu_input_in,
const ::webnn::SupportedDataTypes& expand_input_in,
const ::webnn::SupportedDataTypes& gather_input_in,
const ::webnn::SupportedDataTypes& gather_indices_in,
const ::webnn::SupportedDataTypes& gather_elements_input_in,
const ::webnn::SupportedDataTypes& gather_elements_indices_in,
const ::webnn::SupportedDataTypes& gelu_input_in,
const ::webnn::SupportedDataTypes& gemm_input_in,
const ::webnn::SupportedDataTypes& hard_sigmoid_input_in,
const ::webnn::SupportedDataTypes& hard_swish_input_in,
const ::webnn::SupportedDataTypes& leaky_relu_input_in,
const ::webnn::SupportedDataTypes& linear_input_in,
const ::webnn::SupportedDataTypes& matmul_input_in,
const ::webnn::SupportedDataTypes& pad_input_in,
const ::webnn::SupportedDataTypes& average_pool2d_input_in,
const ::webnn::SupportedDataTypes& l2_pool2d_input_in,
const ::webnn::SupportedDataTypes& max_pool2d_input_in,
const ::webnn::SupportedDataTypes& prelu_input_in,
const ::webnn::SupportedDataTypes& reduce_l1_input_in,
const ::webnn::SupportedDataTypes& reduce_l2_input_in,
const ::webnn::SupportedDataTypes& reduce_log_sum_input_in,
const ::webnn::SupportedDataTypes& reduce_log_sum_exp_input_in,
const ::webnn::SupportedDataTypes& reduce_max_input_in,
const ::webnn::SupportedDataTypes& reduce_mean_input_in,
const ::webnn::SupportedDataTypes& reduce_min_input_in,
const ::webnn::SupportedDataTypes& reduce_product_input_in,
const ::webnn::SupportedDataTypes& reduce_sum_input_in,
const ::webnn::SupportedDataTypes& reduce_sum_square_input_in,
const ::webnn::SupportedDataTypes& relu_input_in,
const ::webnn::SupportedDataTypes& resample2d_input_in,
const ::webnn::SupportedDataTypes& reshape_input_in,
const ::webnn::SupportedDataTypes& sigmoid_input_in,
const ::webnn::SupportedDataTypes& slice_input_in,
const ::webnn::SupportedDataTypes& softmax_input_in,
const ::webnn::SupportedDataTypes& softplus_input_in,
const ::webnn::SupportedDataTypes& softsign_input_in,
const ::webnn::SupportedDataTypes& split_input_in,
const ::webnn::SupportedDataTypes& tanh_input_in,
const ::webnn::SupportedDataTypes& transpose_input_in,
const ::webnn::SupportedDataTypes& triangular_input_in,
const ::webnn::SupportedDataTypes& where_condition_in,
const ::webnn::SupportedDataTypes& where_value_in)
: … { … }
DataTypeLimits::~DataTypeLimits() = default;
void DataTypeLimits::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool DataTypeLimits::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
ContextProperties::ContextProperties()
: … { … }
ContextProperties::ContextProperties(
InputOperandLayout input_operand_layout_in,
Resample2DAxes resample_2d_axes_in,
const ::webnn::DataTypeLimits& data_type_limits_in)
: … { … }
ContextProperties::~ContextProperties() = default;
void ContextProperties::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool ContextProperties::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
}
namespace mojo {
bool StructTraits<::webnn::mojom::SupportedDataTypes::DataView, ::webnn::mojom::SupportedDataTypesPtr>::Read(
::webnn::mojom::SupportedDataTypes::DataView input,
::webnn::mojom::SupportedDataTypesPtr* output) { … }
bool StructTraits<::webnn::mojom::DataTypeLimits::DataView, ::webnn::mojom::DataTypeLimitsPtr>::Read(
::webnn::mojom::DataTypeLimits::DataView input,
::webnn::mojom::DataTypeLimitsPtr* output) { … }
bool StructTraits<::webnn::mojom::ContextProperties::DataView, ::webnn::mojom::ContextPropertiesPtr>::Read(
::webnn::mojom::ContextProperties::DataView input,
::webnn::mojom::ContextPropertiesPtr* output) { … }
}
namespace webnn::mojom {
}
#if defined(__clang__)
#pragma clang diagnostic pop
#endif