Skip to content

Commit

Permalink
[onert-micro] fix wrong namespace use in execute ns
Browse files Browse the repository at this point in the history
- fix strange namespace in onert_micro::execute

ONE-DCO-1.0-Signed-off-by: Chunseok Lee <[email protected]>
  • Loading branch information
chunseoklee committed Dec 24, 2024
1 parent 615fa81 commit dfdd669
Show file tree
Hide file tree
Showing 78 changed files with 704 additions and 85 deletions.
10 changes: 9 additions & 1 deletion onert-micro/onert-micro/src/execute/kernels/Abs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ using namespace onert_micro;
using namespace onert_micro::execute;

// NOTE: doesnt currently support dynamic shapes
OMStatus onert_micro::execute::execute_kernel_CircleAbs(const OMExecuteArgs &execute_args)
namespace onert_micro
{
namespace execute
{

OMStatus execute_kernel_CircleAbs(const OMExecuteArgs &execute_args)
{
auto abs_float_lambda = [](const core::OMRuntimeShape &input_shape, const float *input_data,
const core::OMRuntimeShape &output_shape, float *output_data) {
Expand All @@ -31,3 +36,6 @@ OMStatus onert_micro::execute::execute_kernel_CircleAbs(const OMExecuteArgs &exe

return execute_math_common(execute_args, abs_float_lambda);
}

}
}
10 changes: 9 additions & 1 deletion onert-micro/onert-micro/src/execute/kernels/Add.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ constexpr uint32_t outputTensorIdx = 0;

// NOTE: doesnt currently support dynamic shapes
// TODO: reduce code duplication with Mul, Sub
OMStatus onert_micro::execute::execute_kernel_CircleAdd(const OMExecuteArgs &execute_args)
namespace onert_micro
{
namespace execute
{

OMStatus execute_kernel_CircleAdd(const OMExecuteArgs &execute_args)
{
core::OMRuntimeContext &runtime_context = execute_args.runtime_context;
core::OMRuntimeStorage &runtime_storage = execute_args.runtime_storage;
Expand Down Expand Up @@ -204,3 +209,6 @@ OMStatus onert_micro::execute::execute_kernel_CircleAdd(const OMExecuteArgs &exe

return status;
}

}
}
10 changes: 9 additions & 1 deletion onert-micro/onert-micro/src/execute/kernels/AddN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ namespace
constexpr uint32_t outputTensorIdx = 0;
} // namespace

OMStatus onert_micro::execute::execute_kernel_CircleAddN(const OMExecuteArgs &execute_args)
namespace onert_micro
{
namespace execute
{

OMStatus execute_kernel_CircleAddN(const OMExecuteArgs &execute_args)
{
core::OMRuntimeContext &runtime_context = execute_args.runtime_context;
core::OMRuntimeStorage &runtime_storage = execute_args.runtime_storage;
Expand Down Expand Up @@ -72,3 +77,6 @@ OMStatus onert_micro::execute::execute_kernel_CircleAddN(const OMExecuteArgs &ex
}
return status;
}

}
}
10 changes: 9 additions & 1 deletion onert-micro/onert-micro/src/execute/kernels/ArgCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@ constexpr uint32_t outputTensorIdx = 0;

} // namespace

OMStatus onert_micro::execute::execute_arg_common(
namespace onert_micro
{
namespace execute
{

OMStatus execute_arg_common(
const OMExecuteArgs &execute_args,
const std::function<OMStatus(const core::OMRuntimeShape &input1_shape, const float *input1_data,
const int *input2_data, const core::OMRuntimeShape &output_shape,
Expand Down Expand Up @@ -92,3 +97,6 @@ OMStatus onert_micro::execute::execute_arg_common(
}
return status;
}

}
}
10 changes: 9 additions & 1 deletion onert-micro/onert-micro/src/execute/kernels/ArgMax.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@
using namespace onert_micro;
using namespace onert_micro::execute;

OMStatus onert_micro::execute::execute_kernel_CircleArgMax(const OMExecuteArgs &execute_args)
namespace onert_micro
{
namespace execute
{

OMStatus execute_kernel_CircleArgMax(const OMExecuteArgs &execute_args)
{
auto arg_max_float_lambda = [](const core::OMRuntimeShape &input1_shape, const float *input1_data,
const int *input2_data, const core::OMRuntimeShape &output_shape,
Expand All @@ -31,3 +36,6 @@ OMStatus onert_micro::execute::execute_kernel_CircleArgMax(const OMExecuteArgs &

return execute_arg_common(execute_args, arg_max_float_lambda);
}

}
}
10 changes: 9 additions & 1 deletion onert-micro/onert-micro/src/execute/kernels/ArgMin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@
using namespace onert_micro;
using namespace onert_micro::execute;

OMStatus onert_micro::execute::execute_kernel_CircleArgMin(const OMExecuteArgs &execute_args)
namespace onert_micro
{
namespace execute
{

OMStatus execute_kernel_CircleArgMin(const OMExecuteArgs &execute_args)
{
auto arg_max_float_lambda = [](const core::OMRuntimeShape &input1_shape, const float *input1_data,
const int *input2_data, const core::OMRuntimeShape &output_shape,
Expand All @@ -31,3 +36,6 @@ OMStatus onert_micro::execute::execute_kernel_CircleArgMin(const OMExecuteArgs &

return execute_arg_common(execute_args, arg_max_float_lambda);
}

}
}
10 changes: 9 additions & 1 deletion onert-micro/onert-micro/src/execute/kernels/AveragePool2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ using namespace onert_micro;
using namespace onert_micro::execute;

// NOTE: doesnt currently support dynamic shapes
OMStatus onert_micro::execute::execute_kernel_CircleAveragePool2D(const OMExecuteArgs &execute_args)
namespace onert_micro
{
namespace execute
{

OMStatus execute_kernel_CircleAveragePool2D(const OMExecuteArgs &execute_args)
{
auto avg_pool_float_lambda = [](const core::Pool2DParams &params,
const core::OMRuntimeShape &input_shape, const float *input_data,
Expand All @@ -44,3 +49,6 @@ OMStatus onert_micro::execute::execute_kernel_CircleAveragePool2D(const OMExecut

return execute_pooling_common(execute_args, avg_pool_float_lambda, avg_pool_int8_lambda);
}

}
}
10 changes: 9 additions & 1 deletion onert-micro/onert-micro/src/execute/kernels/BatchToSpaceND.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@
using namespace onert_micro;
using namespace onert_micro::execute;

OMStatus onert_micro::execute::execute_kernel_CircleBatchToSpaceND(
namespace onert_micro
{
namespace execute
{

OMStatus execute_kernel_CircleBatchToSpaceND(
const onert_micro::execute::OMExecuteArgs &execute_args)
{
auto batch_to_space_float_lambda =
Expand All @@ -34,3 +39,6 @@ OMStatus onert_micro::execute::execute_kernel_CircleBatchToSpaceND(

return execute_spaces_batches_nd_common(execute_args, batch_to_space_float_lambda);
}

}
}
10 changes: 9 additions & 1 deletion onert-micro/onert-micro/src/execute/kernels/Cast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ constexpr uint32_t outputTensorIdx = 0;
} // namespace

// NOTE: doesnt currently support dynamic shapes
OMStatus onert_micro::execute::execute_kernel_CircleCast(const OMExecuteArgs &execute_args)
namespace onert_micro
{
namespace execute
{

OMStatus execute_kernel_CircleCast(const OMExecuteArgs &execute_args)
{
const circle::Tensor *input = nullptr;
const circle::Tensor *output = nullptr;
Expand Down Expand Up @@ -98,3 +103,6 @@ OMStatus onert_micro::execute::execute_kernel_CircleCast(const OMExecuteArgs &ex

return status;
}

}
}
10 changes: 9 additions & 1 deletion onert-micro/onert-micro/src/execute/kernels/Ceil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ using namespace onert_micro;
using namespace onert_micro::execute;

// NOTE: doesnt currently support dynamic shapes
OMStatus onert_micro::execute::execute_kernel_CircleCeil(const OMExecuteArgs &execute_args)
namespace onert_micro
{
namespace execute
{

OMStatus execute_kernel_CircleCeil(const OMExecuteArgs &execute_args)
{
auto ceil_float_lambda = [](const core::OMRuntimeShape &input_shape, const float *input_data,
const core::OMRuntimeShape &output_shape, float *output_data) {
Expand All @@ -30,3 +35,6 @@ OMStatus onert_micro::execute::execute_kernel_CircleCeil(const OMExecuteArgs &ex

return execute_math_common(execute_args, ceil_float_lambda);
}

}
}
10 changes: 9 additions & 1 deletion onert-micro/onert-micro/src/execute/kernels/Concatenation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,12 @@ template <typename T> OMStatus evalGeneric(OMRuntimeKernel &runtime_kernel)

} // namespace

OMStatus onert_micro::execute::execute_kernel_CircleConcatenation(const OMExecuteArgs &execute_args)
namespace onert_micro
{
namespace execute
{

OMStatus execute_kernel_CircleConcatenation(const OMExecuteArgs &execute_args)
{
core::OMRuntimeContext &runtime_context = execute_args.runtime_context;
core::OMRuntimeStorage &runtime_storage = execute_args.runtime_storage;
Expand Down Expand Up @@ -115,3 +120,6 @@ OMStatus onert_micro::execute::execute_kernel_CircleConcatenation(const OMExecut

return status;
}

}
}
10 changes: 9 additions & 1 deletion onert-micro/onert-micro/src/execute/kernels/Conv2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ constexpr uint32_t outputTensorIdx = 0;
} // namespace

// NOTE: doesn't currently support dynamic shapes
OMStatus onert_micro::execute::execute_kernel_CircleConv2D(const OMExecuteArgs &execute_args)
namespace onert_micro
{
namespace execute
{

OMStatus execute_kernel_CircleConv2D(const OMExecuteArgs &execute_args)
{
core::OMRuntimeContext &runtime_context = execute_args.runtime_context;
core::OMRuntimeStorage &runtime_storage = execute_args.runtime_storage;
Expand Down Expand Up @@ -174,3 +179,6 @@ OMStatus onert_micro::execute::execute_kernel_CircleConv2D(const OMExecuteArgs &

return status;
}

}
}
16 changes: 11 additions & 5 deletions onert-micro/onert-micro/src/execute/kernels/ConvolutionCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@
using namespace onert_micro;
using namespace onert_micro::core;

OMStatus onert_micro::execute::createConvParams(core::ConvQuant &params,
const circle::Tensor *input,
const circle::Tensor *filter,
const circle::Tensor *output,
circle::ActivationFunctionType act_type)
namespace onert_micro
{
namespace execute
{

OMStatus createConvParams(core::ConvQuant &params, const circle::Tensor *input,
const circle::Tensor *filter, const circle::Tensor *output,
circle::ActivationFunctionType act_type)
{
assert(input->quantization() != nullptr); // Fix caller
assert(filter->quantization() != nullptr); // Fix caller
Expand Down Expand Up @@ -93,3 +96,6 @@ OMStatus onert_micro::execute::createConvParams(core::ConvQuant &params,

return Ok;
}

} // namespace execute
} // namespace onert_micro
10 changes: 9 additions & 1 deletion onert-micro/onert-micro/src/execute/kernels/Cos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ using namespace onert_micro;
using namespace onert_micro::execute;

// NOTE: doesnt currently support dynamic shapes
OMStatus onert_micro::execute::execute_kernel_CircleCos(const OMExecuteArgs &execute_args)
namespace onert_micro
{
namespace execute
{

OMStatus execute_kernel_CircleCos(const OMExecuteArgs &execute_args)
{
auto cos_float_lambda = [](const core::OMRuntimeShape &input_shape, const float *input_data,
const core::OMRuntimeShape &output_shape, float *output_data) {
Expand All @@ -30,3 +35,6 @@ OMStatus onert_micro::execute::execute_kernel_CircleCos(const OMExecuteArgs &exe

return execute_math_common(execute_args, cos_float_lambda);
}

}
}
11 changes: 9 additions & 2 deletions onert-micro/onert-micro/src/execute/kernels/DepthwiseConv2D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,13 @@ constexpr uint32_t outputTensorIdx = 0;

} // namespace

namespace onert_micro
{
namespace execute
{

// NOTE: doesn't currently support dynamic shapes
OMStatus
onert_micro::execute::execute_kernel_CircleDepthwiseConv2D(const OMExecuteArgs &execute_args)
OMStatus execute_kernel_CircleDepthwiseConv2D(const OMExecuteArgs &execute_args)
{
core::OMRuntimeContext &runtime_context = execute_args.runtime_context;
core::OMRuntimeStorage &runtime_storage = execute_args.runtime_storage;
Expand Down Expand Up @@ -180,3 +184,6 @@ onert_micro::execute::execute_kernel_CircleDepthwiseConv2D(const OMExecuteArgs &

return status;
}

} // namespace execute
} // namespace onert_micro
10 changes: 9 additions & 1 deletion onert-micro/onert-micro/src/execute/kernels/Dequantize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@ constexpr uint32_t outputTensorIdx = 0;
} // namespace

// NOTE: doesnt currently support dynamic shapes
OMStatus onert_micro::execute::execute_kernel_CircleDequantize(const OMExecuteArgs &execute_args)
namespace onert_micro
{
namespace execute
{

OMStatus execute_kernel_CircleDequantize(const OMExecuteArgs &execute_args)
{
const circle::Tensor *input = nullptr;
const circle::Tensor *output = nullptr;
Expand Down Expand Up @@ -77,3 +82,6 @@ OMStatus onert_micro::execute::execute_kernel_CircleDequantize(const OMExecuteAr

return status;
}

}
}
10 changes: 9 additions & 1 deletion onert-micro/onert-micro/src/execute/kernels/Div.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,12 @@ constexpr uint32_t outputTensorIdx = 0;

// NOTE: doesnt currently support dynamic shapes
// TODO: reduce code duplication with Add, Sub
OMStatus onert_micro::execute::execute_kernel_CircleDiv(const OMExecuteArgs &execute_args)
namespace onert_micro
{
namespace execute
{

OMStatus execute_kernel_CircleDiv(const OMExecuteArgs &execute_args)
{
core::OMRuntimeContext &runtime_context = execute_args.runtime_context;
core::OMRuntimeStorage &runtime_storage = execute_args.runtime_storage;
Expand Down Expand Up @@ -164,3 +169,6 @@ OMStatus onert_micro::execute::execute_kernel_CircleDiv(const OMExecuteArgs &exe

return status;
}

}
}
10 changes: 9 additions & 1 deletion onert-micro/onert-micro/src/execute/kernels/Elu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ constexpr uint32_t outputTensorIdx = 0;
} // namespace

// NOTE: doesnt currently support dynamic shapes
OMStatus onert_micro::execute::execute_kernel_CircleElu(const OMExecuteArgs &execute_args)
namespace onert_micro
{
namespace execute
{

OMStatus execute_kernel_CircleElu(const OMExecuteArgs &execute_args)
{
core::OMRuntimeContext &runtime_context = execute_args.runtime_context;
core::OMRuntimeStorage &runtime_storage = execute_args.runtime_storage;
Expand Down Expand Up @@ -95,3 +100,6 @@ OMStatus onert_micro::execute::execute_kernel_CircleElu(const OMExecuteArgs &exe

return status;
}

}
}
Loading

0 comments on commit dfdd669

Please sign in to comment.