ONE - On-device Neural Engine
Loading...
Searching...
No Matches
Less.cpp
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024 Samsung Electronics Co., Ltd. All Rights Reserved
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
18#include "OMStatus.h"
20#include "core/OMUtils.h"
22#include "PALComparisons.h"
23
24#include "execute/OMUtils.h"
25
26using namespace onert_micro;
27using namespace onert_micro::core;
28using namespace onert_micro::execute;
29
30namespace
31{
32
33constexpr uint32_t input1TensorIdx = 0;
34constexpr uint32_t input2TensorIdx = 1;
35constexpr uint32_t outputTensorIdx = 0;
36
37} // namespace
38
39namespace onert_micro
40{
41namespace execute
42{
43
45{
46 OMStatus status = Ok;
47
48 const circle::Tensor *input1 = nullptr;
49 const circle::Tensor *input2 = nullptr;
50 const circle::Tensor *output = nullptr;
51
52 OMRuntimeKernel runtime_kernel;
53
54 TISOHeader(execute_args, &input1, &input2, &output, &runtime_kernel);
55
56 switch (input1->type())
57 {
58 case circle::TensorType_INT64:
59 onert_micro::execute::evalComparisonGeneric<int64_t>(&runtime_kernel,
61 break;
62 case circle::TensorType_INT32:
63 onert_micro::execute::evalComparisonGeneric<int32_t>(&runtime_kernel,
65 break;
66#ifndef DIS_QUANT
67 case circle::TensorType_UINT8:
68 evalQuantizedComparisonGeneric<uint8_t, int32_t>(&runtime_kernel,
70 break;
71 case circle::TensorType_INT8:
72 evalQuantizedComparisonGeneric<int8_t, int32_t>(&runtime_kernel,
74 break;
75#endif // DIS_QUANT
76
77#ifndef DIS_FLOAT
78 case circle::TensorType_FLOAT32:
79 onert_micro::execute::evalComparisonGeneric<float>(&runtime_kernel,
81 break;
82#endif // DIS_FLOAT
83 default:
84 assert(false && "Unsupported type.");
85 }
86
87 return status;
88}
89
90} // namespace execute
91} // namespace onert_micro
constexpr uint32_t input1TensorIdx
constexpr uint32_t outputTensorIdx
constexpr uint32_t input2TensorIdx
bool LessFn(T lhs, T rhs)
OMStatus execute_kernel_CircleLess(const OMExecuteArgs &execute_args)
Definition Less.cpp:44
OMStatus TISOHeader(const OMExecuteArgs &execute_args, const circle::Tensor **input1, const circle::Tensor **input2, const circle::Tensor **output, OMRuntimeKernel *runtime_kernel)
Definition OMUtils.cpp:240