ONE - On-device Neural Engine
Loading...
Searching...
No Matches
GreaterEqual.cpp
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 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
17#include "Builders.h"
18#include "ComparisonCommon.h"
19#include "TISOKernel.h"
20
21namespace luci_interpreter
22{
23
24void configure_kernel_CircleGreaterEqual(const circle::Operator *cur_op,
25 BaseRuntimeGraph *runtime_graph)
26{
27 kernels::TISOKernel kernel(cur_op, runtime_graph);
28
29 LUCI_INTERPRETER_CHECK(Tensor::element_type(kernel.input1()) ==
30 Tensor::element_type(kernel.input2()));
31 LUCI_INTERPRETER_CHECK(Tensor::element_type(kernel.output()) == DataType::BOOL);
32}
33
34void execute_kernel_CircleGreaterEqual(const circle::Operator *cur_op,
35 BaseRuntimeGraph *runtime_graph)
36{
37 kernels::TISOKernel kernel(cur_op, runtime_graph);
38
39 switch (Tensor::element_type(kernel.input1()))
40 {
41 case DataType::S64:
42 kernels::evalComparisonGeneric<int64_t>(kernel.input1(), kernel.input2(), kernel.output(),
44 break;
45 case DataType::S32:
46 kernels::evalComparisonGeneric<int32_t>(kernel.input1(), kernel.input2(), kernel.output(),
48 break;
49#ifndef DIS_FLOAT
50 case DataType::FLOAT32:
51 kernels::evalComparisonGeneric<float>(kernel.input1(), kernel.input2(), kernel.output(),
53 break;
54#endif // DIS_FLOAT
55 default:
56 assert(false && "Unsupported type.");
57 }
58}
59
60} // namespace luci_interpreter
const circle::Tensor * output() const
Definition TISOKernel.h:62
const circle::Tensor * input2() const
Definition TISOKernel.h:61
const circle::Tensor * input1() const
Definition TISOKernel.h:60
#define LUCI_INTERPRETER_CHECK(cond)
Definition Utils.h:36
bool GreaterEqualFn(T lhs, T rhs)
void configure_kernel_CircleGreaterEqual(const circle::Operator *cur_op, BaseRuntimeGraph *runtime_graph)
void execute_kernel_CircleGreaterEqual(const circle::Operator *cur_op, BaseRuntimeGraph *runtime_graph)