[PureCL] Handle TENSOR_QUANT8_ASYMM conversion (#1622)
author서상민/동작제어Lab(SR)/Staff Engineer/삼성전자 <sangmin7.seo@samsung.com>
Fri, 8 Jun 2018 07:02:21 +0000 (16:02 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Fri, 8 Jun 2018 07:02:21 +0000 (16:02 +0900)
For issue #1481

This patch revises conversion functions to handle
ANEURALNETWORKS_TENSOR_QUANT8_ASYMM as well.

Signed-off-by: Sangmin Seo <sangmin7.seo@samsung.com>
runtimes/pure_arm_compute/src/execution.cc

index 3934cc5..c71a1d0 100644 (file)
@@ -93,6 +93,10 @@ static void asVectorSource(ANeuralNetworksExecution *execution, int32_t type, in
       execution->source<VectorSource<uint32_t>>(index, len,
                                                 reinterpret_cast<const uint32_t *>(buffer), length);
       break;
+    case ANEURALNETWORKS_TENSOR_QUANT8_ASYMM:
+      execution->source<VectorSource<uint8_t>>(index, len,
+                                               reinterpret_cast<const uint8_t *>(buffer), length);
+      break;
     default:
       throw std::runtime_error("Not supported, yet");
       break;
@@ -119,6 +123,10 @@ static void asFeatureSource(ANeuralNetworksExecution *execution, int32_t type, i
       execution->source<FeatureSource<uint32_t>>(
           index, shape, reinterpret_cast<const uint32_t *>(buffer), length);
       break;
+    case ANEURALNETWORKS_TENSOR_QUANT8_ASYMM:
+      execution->source<FeatureSource<uint8_t>>(index, shape,
+                                                reinterpret_cast<const uint8_t *>(buffer), length);
+      break;
     default:
       throw std::runtime_error("Not supported, yet");
       break;
@@ -142,6 +150,9 @@ static void asVectorSink(ANeuralNetworksExecution *execution, int32_t type, int3
       execution->sink<VectorSink<uint32_t>>(index, len, reinterpret_cast<uint32_t *>(buffer),
                                             length);
       break;
+    case ANEURALNETWORKS_TENSOR_QUANT8_ASYMM:
+      execution->sink<VectorSink<uint8_t>>(index, len, reinterpret_cast<uint8_t *>(buffer), length);
+      break;
     default:
       throw std::runtime_error("Not supported, yet");
       break;
@@ -166,6 +177,10 @@ static void asFeatureSink(ANeuralNetworksExecution *execution, int32_t type, int
       execution->sink<FeatureSink<uint32_t>>(index, shape, reinterpret_cast<uint32_t *>(buffer),
                                              length);
       break;
+    case ANEURALNETWORKS_TENSOR_QUANT8_ASYMM:
+      execution->sink<FeatureSink<uint8_t>>(index, shape, reinterpret_cast<uint8_t *>(buffer),
+                                            length);
+      break;
     default:
       throw std::runtime_error("Not supported, yet");
       break;
@@ -190,6 +205,10 @@ static void asTensorSink(ANeuralNetworksExecution *execution, int32_t type, int3
       execution->sink<TensorSink<uint32_t>>(index, shape, reinterpret_cast<uint32_t *>(buffer),
                                             length);
       break;
+    case ANEURALNETWORKS_TENSOR_QUANT8_ASYMM:
+      execution->sink<TensorSink<uint8_t>>(index, shape, reinterpret_cast<uint8_t *>(buffer),
+                                           length);
+      break;
     default:
       throw std::runtime_error("Not supported, yet");
       break;