2 * Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #include "LogicalOrLayer.h"
19 #include "OperationUtils.h"
21 #include <cker/operation/LogicalOr.h>
31 void LogicalOrLayer::lorBool8()
33 if (!HaveSameShapes(_lhs, _rhs))
35 nnfw::cker::LogicalOrBroadcast<bool>(
36 getTensorShape(_lhs), reinterpret_cast<const bool *>(_lhs->buffer()), getTensorShape(_rhs),
37 reinterpret_cast<const bool *>(_rhs->buffer()), getTensorShape(_output),
38 reinterpret_cast<bool *>(_output->buffer()));
42 nnfw::cker::LogicalOrElementwise<bool>(getTensorShape(_lhs),
43 reinterpret_cast<const bool *>(_lhs->buffer()),
44 reinterpret_cast<const bool *>(_rhs->buffer()),
45 reinterpret_cast<bool *>(_output->buffer()));
49 void LogicalOrLayer::configure(const IPortableTensor *lhs, const IPortableTensor *rhs,
50 IPortableTensor *output)
52 assert(lhs != nullptr);
53 assert(rhs != nullptr);
54 assert(output != nullptr);
61 void LogicalOrLayer::run()
63 if ((_lhs->data_type() == OperandType::BOOL8) && (_rhs->data_type() == OperandType::BOOL8))
69 throw std::runtime_error{"LogicalOr: Unsupported data type"};
75 } // namespace backend