Fix concat for not rank 4 (#4317)
author오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Fri, 25 Jan 2019 06:24:33 +0000 (15:24 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Fri, 25 Jan 2019 06:24:33 +0000 (15:24 +0900)
Now concat operation rank is not 4 can run using cpu implementation

Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
runtimes/neurun/src/backend/acl_cl/kernel/ConcatLayer.cc
tests/scripts/neurun_frameworktest_list.armv7l.acl_cl.txt
tests/scripts/neurun_frameworktest_list.armv7l.cpu.txt
tests/scripts/neurun_frameworktest_list.x86-64.cpu.txt

index e8a438d..142e9c5 100644 (file)
@@ -19,6 +19,7 @@
 #include <arm_compute/runtime/CL/CLScheduler.h>
 
 #include "util/feature/nchw/View.h"
+#include "backend/acl_cl/Swizzle.h"
 #include "util/logging.h"
 
 namespace
@@ -135,10 +136,12 @@ void ConcatLayer::configure(
 
   assert(axis < 4);
 
+  // TODO Handle when axis is negative
+  assert(axis >= 0);
+
   // This map converts NHWC to NCHW(reversed)
   // NHWC -> WHCN
-  static const uint32_t axis_map[] = {3, 1, 0, 2};
-  _axis = axis_map[axis];
+  _axis = ToARMComputeAxis(output_alloc->num_dimensions(), axis).value();
 
   // TODO Support Quant8
   _input_type = OperandType::TENSOR_FLOAT32;
index 4adc956..60d6e1e 100644 (file)
@@ -1,8 +1,7 @@
 add/1D
 add/4D
 average_pool_2d
-concat/concat1
-concat/concat2
+concat
 conv_2d
 fullyconnected/fc1
 max_pool_2d
index 9c4e97d..91413e5 100644 (file)
@@ -1,6 +1,5 @@
 average_pool_2d
-concat/concat1
-concat/concat2
+concat
 conv_2d
 fullyconnected/fc1
 max_pool_2d
index 9c4e97d..91413e5 100644 (file)
@@ -1,6 +1,5 @@
 average_pool_2d
-concat/concat1
-concat/concat2
+concat
 conv_2d
 fullyconnected/fc1
 max_pool_2d