26#include "PALSquaredDifference.h"
34constexpr uint32_t numInput = 2;
35constexpr uint32_t numOutput = 1;
46onert_micro::execute::execute_kernel_CircleSquaredDifference(
const OMExecuteArgs &execute_args)
52 const circle::Tensor *input1;
53 const circle::Tensor *input2;
54 const circle::Tensor *
output;
63 runtime_kernel.
readKernel(op_index, runtime_context);
68 assert(input1 !=
nullptr);
69 assert(input2 !=
nullptr);
70 assert(output !=
nullptr);
77 assert(input1_data !=
nullptr);
78 assert(input2_data !=
nullptr);
79 assert(output_data !=
nullptr);
91 switch (input1->type())
94 case circle::TensorType_FLOAT32:
97 circle::ActivationFunctionType::ActivationFunctionType_NONE, ¶ms.float_activation_min,
98 ¶ms.float_activation_max);
102 params, input1_shape, core::utils::castInputData<float>(input1_data), input2_shape,
103 core::utils::castInputData<float>(input2_data),
output_shape,
104 core::utils::castOutputData<float>(output_data));
109 core::utils::castInputData<float>(input1_data),
110 core::utils::castInputData<float>(input2_data),
111 core::utils::castOutputData<float>(output_data));
119 assert(
false &&
"Unsupported type.");
uint8_t * outputs_data[maxOutputSize]
OMStatus getDataFromStorage(uint16_t op_index, core::OMRuntimeStorage &storage, core::OMRuntimeContext &context)
uint8_t * inputs_data[maxInputSize]
OMStatus readKernel(uint16_t op_index, core::OMRuntimeContext &runtime_context)
const circle::Tensor * outputs[maxOutputSize]
const circle::Tensor * inputs[maxInputSize]
const luci_interpreter::RuntimeShape output_shape
constexpr uint32_t input1TensorIdx
constexpr uint32_t outputTensorIdx
constexpr uint32_t input2TensorIdx
const std::vector< float > input1_data
const std::vector< float > input2_data
OMStatus BroadcastSquaredDifference4DSlow(const core::BinaryArithmeticBroadcastParams ¶ms, const core::OMRuntimeShape &input1_shape, const T *input1_data, const core::OMRuntimeShape &input2_shape, const T *input2_data, const core::OMRuntimeShape &output_shape, T *output_data)
bool processBroadcastShapes(const core::OMRuntimeShape &shape0, const core::OMRuntimeShape &shape1, core::BinaryArithmeticBroadcastParams *params)
OMStatus SquaredDifference(const core::BinaryArithmeticBroadcastParams ¶ms, const int flat_size, const T *input1_data, const T *input2_data, T *output_data)
OMStatus calculateActivationRange(circle::ActivationFunctionType activation, T *activation_min, T *activation_max)
core::OMRuntimeContext & runtime_context
core::OMRuntimeStorage & runtime_storage