-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[onert-micro] Reduce code duplication
This pr reduces code duplication for pooling execute part and for Mul and Add ops. ONE-DCO-1.0-Signed-off-by: Artem Balyshev <[email protected]>
- Loading branch information
Artem Balyshev
committed
Jun 24, 2024
1 parent
22bce71
commit 6120d7c
Showing
10 changed files
with
286 additions
and
370 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
onert-micro/onert-micro/include/execute/kernels/PoolingCommon.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Copyright (c) 2024 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_MICRO_EXECUTE_KERNELS_POOLING_COMMON_H | ||
#define ONERT_MICRO_EXECUTE_KERNELS_POOLING_COMMON_H | ||
|
||
#include "OMStatus.h" | ||
|
||
#include "core/OMUtils.h" | ||
#include "core/OMKernelData.h" | ||
|
||
#include "execute/OMKernelExecutionBuilder.h" | ||
#include "execute/OMUtils.h" | ||
#include "execute/OMRuntimeKernel.h" | ||
#include <functional> | ||
|
||
namespace onert_micro | ||
{ | ||
namespace execute | ||
{ | ||
|
||
OMStatus execute_pooling_common( | ||
const OMExecuteArgs &execute_args, | ||
const std::function<OMStatus(const core::Pool2DParams ¶ms, | ||
const core::OMRuntimeShape &input_shape, const float *input_data, | ||
const core::OMRuntimeShape &output_shape, float *output_data)> | ||
&f_float, | ||
const std::function<OMStatus(const core::Pool2DParams ¶ms, | ||
const core::OMRuntimeShape &input_shape, const int8_t *input_data, | ||
const core::OMRuntimeShape &output_shape, int8_t *output_data)> | ||
&f_int8); | ||
|
||
} // namespace execute | ||
} // namespace onert_micro | ||
|
||
#endif // ONERT_MICRO_EXECUTE_KERNELS_POOLING_COMMON_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.