-
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] Support S8 Mul (#13204)
This pr adds supporting of s8 + cmsis_nn. ONE-DCO-1.0-Signed-off-by: Artem Balyshev <[email protected]>
- Loading branch information
1 parent
0fd8669
commit 6f1d1d3
Showing
11 changed files
with
555 additions
and
9 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
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,52 @@ | ||
/* | ||
* Copyright (c) 2024 Samsung Electronics Co., Ltd. All Rights Reserved | ||
* Copyright 2017 The TensorFlow Authors. 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_PAL_MUL_H | ||
#define ONERT_MICRO_EXECUTE_PAL_MUL_H | ||
|
||
#include "PALMulCommon.h" | ||
#include "PALUtils.h" | ||
|
||
#include "arm_nnfunctions.h" | ||
|
||
namespace onert_micro | ||
{ | ||
namespace execute | ||
{ | ||
namespace pal | ||
{ | ||
|
||
OMStatus Mul(const core::ArithmeticQuantParams ¶ms, const uint32_t flat_size, | ||
const int8_t *input1_data, const int8_t *input2_data, int8_t *output_data) | ||
{ | ||
auto status = arm_elementwise_mul_s8( | ||
input1_data, input2_data, params.input1_offset, params.input2_offset, output_data, | ||
params.output_offset, params.output_multiplier, params.output_shift, | ||
params.quantized_activation_min, params.quantized_activation_max, flat_size); | ||
assert(status == ARM_CMSIS_NN_SUCCESS); | ||
|
||
if (status != ARM_CMSIS_NN_SUCCESS) | ||
return UnknownError; | ||
|
||
return Ok; | ||
} | ||
|
||
} // namespace pal | ||
} // namespace execute | ||
} // namespace onert_micro | ||
|
||
#endif // ONERT_MICRO_EXECUTE_PAL_ADD_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.