Introduce backend config for subtensor (#3460)
author오형석/동작제어Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Mon, 5 Nov 2018 05:58:51 +0000 (14:58 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Mon, 5 Nov 2018 05:58:51 +0000 (14:58 +0900)
Introduce backend config for subtensor
CPU and ACL backend are not support subtensor yet

Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
runtimes/neurun/src/backend/acl_cl/Config.h
runtimes/neurun/src/backend/cpu/Config.h
runtimes/neurun/src/backend/interface/IConfig.h

index d080881..cb001db 100644 (file)
@@ -37,6 +37,11 @@ public:
   virtual std::string id() override { return "acl_cl"; }
   virtual void initialize() override;
   virtual graph::operand::Layout getOperandLayout() { return graph::operand::Layout::NCHW; }
+  virtual bool SupportSubTensorAlloc() override
+  {
+    // NOTE ACL allocator cannot support subtensor allocation yet
+    return false;
+  }
 };
 
 } // namespace acl_cl
index e4d35fe..ad9ca0e 100644 (file)
@@ -37,6 +37,11 @@ public:
   virtual std::string id() override { return "cpu"; }
   virtual void initialize() override;
   virtual graph::operand::Layout getOperandLayout() { return graph::operand::Layout::NHWC; }
+  virtual bool SupportSubTensorAlloc() override
+  {
+    // NOTE CPU allocator cannot support subtensor allocation yet
+    return false;
+  }
 };
 
 } // namespace cpu
index 1443057..82789d0 100644 (file)
@@ -34,6 +34,8 @@ struct IConfig
   virtual void initialize() = 0;
   // NOTE Assume backend has only one type of operand layout
   virtual graph::operand::Layout getOperandLayout() = 0;
+  // Support subtensor allocation
+  virtual bool SupportSubTensorAlloc() = 0;
 };
 
 } // namespace backend