diff options
author | Chunseok Lee <chunseok.lee@samsung.com> | 2020-09-05 21:49:46 +0900 |
---|---|---|
committer | Chunseok Lee <chunseok.lee@samsung.com> | 2020-09-05 21:49:46 +0900 |
commit | 74476a2d0296bdad70a2f7f90bc7419a8b05bffd (patch) | |
tree | 3f991636c1e9423d38eb16a384c20b569b0d678e /runtime/onert/backend/cpu/ops/ElementwiseBinaryLayer.h | |
parent | 042b262b3633b6c0f577aed6cb4b980ad0c1dcf3 (diff) | |
download | nnfw-74476a2d0296bdad70a2f7f90bc7419a8b05bffd.tar.gz nnfw-74476a2d0296bdad70a2f7f90bc7419a8b05bffd.tar.bz2 nnfw-74476a2d0296bdad70a2f7f90bc7419a8b05bffd.zip |
Imported Upstream version 1.9.0upstream/1.9.0submit/tizen/20200905.125700accepted/tizen/unified/20200906.032650
Diffstat (limited to 'runtime/onert/backend/cpu/ops/ElementwiseBinaryLayer.h')
-rw-r--r-- | runtime/onert/backend/cpu/ops/ElementwiseBinaryLayer.h | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/runtime/onert/backend/cpu/ops/ElementwiseBinaryLayer.h b/runtime/onert/backend/cpu/ops/ElementwiseBinaryLayer.h new file mode 100644 index 000000000..052747a4c --- /dev/null +++ b/runtime/onert/backend/cpu/ops/ElementwiseBinaryLayer.h @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __ONERT_BACKEND_CPU_OPS_ELEMENTWISEBINARYLAYER_H__ +#define __ONERT_BACKEND_CPU_OPS_ELEMENTWISEBINARYLAYER_H__ + +#include <backend/IPortableTensor.h> + +#include <exec/IFunction.h> + +namespace onert +{ +namespace backend +{ +namespace cpu +{ +namespace ops +{ + +enum class ElementwiseBinaryType +{ + kLogicalAnd, + kLogicalOr, + kMax, + kMin, +}; + +class ElementwiseBinaryLayer : public ::onert::exec::IFunction +{ +public: + ElementwiseBinaryLayer() : _lhs(nullptr), _rhs(nullptr), _output(nullptr) + { + // DO NOTHING + } + +public: + void configure(const IPortableTensor *lhs, const IPortableTensor *rhs, IPortableTensor *output, + const ElementwiseBinaryType op_type); + + void run() override; + +private: + const IPortableTensor *_lhs; + const IPortableTensor *_rhs; + IPortableTensor *_output; + std::function<void(const IPortableTensor *, const IPortableTensor *, IPortableTensor *)> _kernel; +}; + +} // namespace ops +} // namespace cpu +} // namespace backend +} // namespace onert + +#endif // __ONERT_BACKEND_CPU_OPS_ELEMENTWISEBINARYLAYER_H__ |