aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/CPP
diff options
context:
space:
mode:
authorSheri Zhang <sheri.zhang@arm.com>2020-03-16 21:25:52 +0000
committerSheri Zhang <sheri.zhang@arm.com>2020-03-23 11:23:18 +0000
commitd9a623a1729a9a613f7dcf8cf8536e5d8dd921b4 (patch)
tree315525f3c90dc0111edeb6cc8015c67f2b7813e7 /src/runtime/CPP
parent970353e3e9ee402ab7294230654b5b9151cd57f3 (diff)
downloadComputeLibrary-d9a623a1729a9a613f7dcf8cf8536e5d8dd921b4.tar.gz
COMPMID-3274: Add support for QASYMM8_SIGNED in CPPBoxWithNonMaximaSuppressionLimit
Signed-off-by: Sheri Zhang <sheri.zhang@arm.com> Change-Id: I2b95dbf97eb852d9cd72710d79a40de82ea37595 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/2894 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/runtime/CPP')
-rw-r--r--src/runtime/CPP/functions/CPPBoxWithNonMaximaSuppressionLimit.cpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/src/runtime/CPP/functions/CPPBoxWithNonMaximaSuppressionLimit.cpp b/src/runtime/CPP/functions/CPPBoxWithNonMaximaSuppressionLimit.cpp
index d4be939c52..232f71dbea 100644
--- a/src/runtime/CPP/functions/CPPBoxWithNonMaximaSuppressionLimit.cpp
+++ b/src/runtime/CPP/functions/CPPBoxWithNonMaximaSuppressionLimit.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019 ARM Limited.
+ * Copyright (c) 2018-2020 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -49,6 +49,13 @@ void dequantize_tensor(const ITensor *input, ITensor *output)
},
input_it, output_it);
break;
+ case DataType::QASYMM8_SIGNED:
+ execute_window_loop(window, [&](const Coordinates &)
+ {
+ *reinterpret_cast<float *>(output_it.ptr()) = dequantize_qasymm8_signed(*reinterpret_cast<const int8_t *>(input_it.ptr()), qinfo);
+ },
+ input_it, output_it);
+ break;
case DataType::QASYMM16:
execute_window_loop(window, [&](const Coordinates &)
{
@@ -80,6 +87,13 @@ void quantize_tensor(const ITensor *input, ITensor *output)
},
input_it, output_it);
break;
+ case DataType::QASYMM8_SIGNED:
+ execute_window_loop(window, [&](const Coordinates &)
+ {
+ *reinterpret_cast<int8_t *>(output_it.ptr()) = quantize_qasymm8_signed(*reinterpret_cast<const float *>(input_it.ptr()), qinfo);
+ },
+ input_it, output_it);
+ break;
case DataType::QASYMM16:
execute_window_loop(window, [&](const Coordinates &)
{
@@ -121,7 +135,7 @@ void CPPBoxWithNonMaximaSuppressionLimit::configure(const ITensor *scores_in, co
{
ARM_COMPUTE_ERROR_ON_NULLPTR(scores_in, boxes_in, scores_out, boxes_out, classes);
- _is_qasymm8 = scores_in->info()->data_type() == DataType::QASYMM8;
+ _is_qasymm8 = scores_in->info()->data_type() == DataType::QASYMM8 || scores_in->info()->data_type() == DataType::QASYMM8_SIGNED;
_scores_in = scores_in;
_boxes_in = boxes_in;
@@ -198,9 +212,9 @@ Status validate(const ITensorInfo *scores_in, const ITensorInfo *boxes_in, const
{
ARM_COMPUTE_UNUSED(batch_splits_in, batch_splits_out, keeps, keeps_size, info);
ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(scores_in, boxes_in, scores_out, boxes_out, classes);
- ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(scores_in, 1, DataType::QASYMM8, DataType::F16, DataType::F32);
+ ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(scores_in, 1, DataType::QASYMM8, DataType::QASYMM8_SIGNED, DataType::F16, DataType::F32);
- const bool is_qasymm8 = scores_in->data_type() == DataType::QASYMM8;
+ const bool is_qasymm8 = scores_in->data_type() == DataType::QASYMM8 || scores_in->data_type() == DataType::QASYMM8_SIGNED;
if(is_qasymm8)
{
ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(boxes_in, 1, DataType::QASYMM16);