-
Notifications
You must be signed in to change notification settings - Fork 159
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 SpaceToBatchND code duplication
This pr reduces code duplication for SpacesBatchesND and BatchToSpaceND. ONE-DCO-1.0-Signed-off-by: Artem Balyshev <[email protected]>
- Loading branch information
Artem Balyshev
committed
Jun 25, 2024
1 parent
41cca4a
commit dd8f03a
Showing
11 changed files
with
313 additions
and
301 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
onert-micro/onert-micro/include/execute/kernels/SpacesBatchesNDCommon.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,46 @@ | ||
/* | ||
* 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_SPACES_BATCHES_ND_COMMON_H | ||
#define ONERT_MICRO_EXECUTE_KERNELS_SPACES_BATCHES_ND_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_spaces_batches_nd_common( | ||
const OMExecuteArgs &execute_args, | ||
const std::function< | ||
OMStatus(const core::OMRuntimeShape &unextended_input1_shape, const float *input1_data, | ||
const core::OMRuntimeShape &unextended_input2_shape, const int32_t *block_shape_data, | ||
const core::OMRuntimeShape &unextended_input3_shape, const int32_t *crops_data, | ||
const core::OMRuntimeShape &unextended_output_shape, float *output_data)> &f); | ||
|
||
} // namespace execute | ||
} // namespace onert_micro | ||
|
||
#endif // ONERT_MICRO_EXECUTE_KERNELS_SPACES_BATCHES_ND_COMMON_H |
38 changes: 38 additions & 0 deletions
38
onert-micro/onert-micro/include/import/helpers/OMSpacesBatchesNDCommon.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,38 @@ | ||
/* | ||
* 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_IMPORT_HELPERS_CONFIGURE_SPACES_BATCHES_ND_COMMON_H | ||
#define ONERT_MICRO_IMPORT_HELPERS_CONFIGURE_SPACES_BATCHES_ND_COMMON_H | ||
|
||
#include "import/OMKernelConfigureBuilder.h" | ||
#include "core/OMUtils.h" | ||
#include "OMStatus.h" | ||
#include "execute/OMRuntimeKernel.h" | ||
|
||
namespace onert_micro | ||
{ | ||
namespace import | ||
{ | ||
namespace helpers | ||
{ | ||
|
||
OMStatus configure_spaces_batches_nd_kernel_common(const OMConfigureArgs &config_args); | ||
|
||
} // namespace helpers | ||
} // namespace import | ||
} // namespace onert_micro | ||
|
||
#endif // ONERT_MICRO_IMPORT_HELPERS_CONFIGURE_SPACES_BATCHES_ND_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.