ONE - On-device Neural Engine
Loading...
Searching...
No Matches
LogicalAnd.cpp
Go to the documentation of this file.
1/*
2 * Copyright (c) 2025 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 "core/OMUtils.h"
18#include "import/OMUtils.h"
19
20using namespace onert_micro::core;
21
22namespace onert_micro::import
23{
24
26{
27 const circle::Tensor *input1;
28 const circle::Tensor *input2;
29 const circle::Tensor *output;
30
31 TISOHeader(config_args, &input1, &input2, &output);
32
33 std::array<circle::TensorType, 3> types = {input1->type(), input2->type(), output->type()};
34
35 // clang-format off
36
37 bool type_check = std::all_of(types.cbegin(), types.cend(), [](const auto& type)
38 {
39 return type == circle::TensorType_BOOL;
40 });
41
42 // clang-format on
43
44 OMStatus status = utils::checkCondition(type_check);
45
46 if (status != Ok)
47 return status;
48
49 const OMRuntimeShape input_shape1(input1);
50 const OMRuntimeShape input_shape2(input2);
51
52 status = utils::checkCondition(input_shape1.flatSize() == input_shape2.flatSize());
53
54 if (status != Ok)
55 return status;
56
57 return utils::checkCondition(input_shape1.dimensionsCount() == input_shape2.dimensionsCount());
58}
59
60} // namespace onert_micro::import
size_t dimensionsCount() const noexcept
OMStatus TISOHeader(const OMConfigureArgs &execute_args, const circle::Tensor **input1, const circle::Tensor **input2, const circle::Tensor **output)
Definition OMUtils.cpp:45
OMStatus configure_kernel_CircleLogicalAnd(const OMConfigureArgs &config_args)