Skip to content

Commit

Permalink
use exec sisoheader for quantize kernels
Browse files Browse the repository at this point in the history
- Use exec SISO header for quantize/dequantize kernel

ONE-DCO-1.0-Signed-off-by: Chunseok Lee <[email protected]>
  • Loading branch information
chunseoklee committed Sep 4, 2024
1 parent 84b94c5 commit 5d826ce
Showing 1 changed file with 4 additions and 26 deletions.
30 changes: 4 additions & 26 deletions onert-micro/onert-micro/src/execute/kernels/MathCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

#include "execute/kernels/MathCommon.h"

#include "execute/OMUtils.h"

using namespace onert_micro;
using namespace onert_micro::execute;

Expand All @@ -33,39 +35,15 @@ OMStatus onert_micro::execute::execute_math_common(
const std::function<OMStatus(const core::OMRuntimeShape &, const float *,
const core::OMRuntimeShape &, float *)> &f_float)
{
core::OMRuntimeContext &runtime_context = execute_args.runtime_context;
core::OMRuntimeStorage &runtime_storage = execute_args.runtime_storage;
uint16_t op_index = execute_args.kernel_index;

const circle::Tensor *input = nullptr;
const circle::Tensor *output = nullptr;

uint8_t *input_data = nullptr;
uint8_t *output_data = nullptr;

OMStatus status = Ok;

{
OMRuntimeKernel runtime_kernel;
runtime_kernel.readKernel(op_index, runtime_context);

input = runtime_kernel.inputs[inputTensorIdx];
output = runtime_kernel.outputs[outputTensorIdx];

assert(input != nullptr);
assert(output != nullptr);

status = runtime_kernel.getDataFromStorage(op_index, runtime_storage, runtime_context);
if (status != Ok)
return status;

input_data = runtime_kernel.inputs_data[inputTensorIdx];
output_data = runtime_kernel.outputs_data[outputTensorIdx];
}

assert(input_data != nullptr);
assert(output_data != nullptr);
SISOHeader(execute_args, &input, &output, &input_data, &output_data);

OMStatus status;
switch (input->type())
{
#ifndef DIS_FLOAT
Expand Down

0 comments on commit 5d826ce

Please sign in to comment.