-
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] TISO Header helper for import TISO kernel (#13923)
* [onert-micro] TISO Header helper for import TISO kernel - TISOHeader helper defined - apply helper to comparison kernels ONE-DCO-1.0-Signed-off-by: Chunseok Lee <[email protected]> * fix format
- Loading branch information
1 parent
9213b12
commit 48bd978
Showing
10 changed files
with
162 additions
and
103 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
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_IMPORT_UTILS_H | ||
#define ONERT_MICRO_IMPORT_UTILS_H | ||
|
||
#include <cmath> | ||
#include "OMStatus.h" | ||
#include "core/reader/OMCircleReader.h" | ||
#include "core/OMRuntimeShape.h" | ||
#include "core/OMKernelData.h" | ||
|
||
#include "import/OMKernelConfigureBuilder.h" | ||
|
||
// FIXME: this dependancy | ||
#include "execute/OMKernelExecutionBuilder.h" | ||
#include "execute/OMRuntimeKernel.h" | ||
|
||
namespace onert_micro | ||
{ | ||
namespace import | ||
{ | ||
|
||
OMStatus SISOHeader(const OMConfigureArgs &execute_args, const circle::Tensor **input, | ||
const circle::Tensor **output); | ||
|
||
OMStatus TISOHeader(const OMConfigureArgs &execute_args, const circle::Tensor **input1, | ||
const circle::Tensor **input2, const circle::Tensor **output); | ||
|
||
} // namespace import | ||
} // namespace onert_micro | ||
|
||
#endif // ONERT_MICRO_IMPORT_UTILS_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
#include "import/OMUtils.h" | ||
#include <cmath> | ||
|
||
using namespace onert_micro::execute; | ||
using namespace onert_micro; | ||
|
||
OMStatus onert_micro::import::SISOHeader(const OMConfigureArgs &execute_args, | ||
const circle::Tensor **input, | ||
const circle::Tensor **output) | ||
{ | ||
OMStatus status; | ||
|
||
core::OMRuntimeContext &runtime_context = execute_args.runtime_context; | ||
core::OMRuntimeStorage &runtime_storage = execute_args.runtime_storage; | ||
uint16_t op_index = execute_args.kernel_index; | ||
|
||
OMRuntimeKernel runtime_kernel; | ||
status = runtime_kernel.readKernel(op_index, runtime_context); | ||
|
||
*input = runtime_kernel.inputs[0]; | ||
*output = runtime_kernel.outputs[0]; | ||
|
||
assert(*input != nullptr); | ||
assert(*output != nullptr); | ||
|
||
return status; | ||
} | ||
|
||
OMStatus onert_micro::import::TISOHeader(const OMConfigureArgs &execute_args, | ||
const circle::Tensor **input1, | ||
const circle::Tensor **input2, | ||
const circle::Tensor **output) | ||
{ | ||
OMStatus status; | ||
|
||
core::OMRuntimeContext &runtime_context = execute_args.runtime_context; | ||
core::OMRuntimeStorage &runtime_storage = execute_args.runtime_storage; | ||
uint16_t op_index = execute_args.kernel_index; | ||
|
||
OMRuntimeKernel runtime_kernel; | ||
status = runtime_kernel.readKernel(op_index, runtime_context); | ||
|
||
*input2 = runtime_kernel.inputs[0]; | ||
*input1 = runtime_kernel.inputs[1]; | ||
*output = runtime_kernel.outputs[0]; | ||
|
||
assert(*input1 != nullptr); | ||
assert(*input2 != nullptr); | ||
assert(*output != nullptr); | ||
|
||
return status; | ||
} |
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
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