Introduce `SupportPermutation` to check if backend supports permutation (#7616)
author장지섭/On-Device Lab(SR)/Engineer/삼성전자 <jiseob.jang@samsung.com>
Mon, 23 Sep 2019 04:54:25 +0000 (13:54 +0900)
committer이한종/On-Device Lab(SR)/Engineer/삼성전자 <hanjoung.lee@samsung.com>
Mon, 23 Sep 2019 04:54:25 +0000 (13:54 +0900)
This commit introduces `SupportPermutation` to check if backend supports permutation.

Signed-off-by: jiseob.jang <jiseob.jang@samsung.com>
runtimes/neurun/backend/acl_cl/Config.h
runtimes/neurun/backend/acl_neon/Config.h
runtimes/neurun/backend/cpu/Config.h
runtimes/neurun/backend/srcn/Config.h
runtimes/neurun/core/include/backend/IConfig.h
runtimes/neurun/test/core/backend/ExecTime.test.cc
runtimes/neurun/test/core/compiler/Scheduler.cc

index 1857651..ae527dd 100644 (file)
@@ -33,6 +33,7 @@ class Config : public IConfig
 public:
   std::string id() override { return "acl_cl"; }
   void initialize() override;
+  bool SupportPermutation() override { return true; }
   bool SupportSubTensorAlloc() override { return true; }
   std::unique_ptr<util::ITimer> timer() override { return nnfw::cpp14::make_unique<CLTimer>(); }
 };
index 0656fa4..13f6c83 100644 (file)
@@ -33,6 +33,7 @@ class Config : public IConfig
 public:
   std::string id() override { return "acl_neon"; }
   void initialize() override;
+  bool SupportPermutation() override { return true; }
   bool SupportSubTensorAlloc() override { return true; }
 
   std::unique_ptr<util::ITimer> timer() override
index ac55d98..262d477 100644 (file)
@@ -33,6 +33,7 @@ class Config : public IConfig
 public:
   std::string id() override { return "cpu"; }
   void initialize() override;
+  bool SupportPermutation() override { return true; }
   bool SupportSubTensorAlloc() override
   {
     // NOTE CPU allocator cannot support subtensor allocation yet
index bffcbf2..fbe2f09 100644 (file)
@@ -31,6 +31,7 @@ class Config : public IConfig
 public:
   std::string id() override { return "srcn"; }
   void initialize() override;
+  bool SupportPermutation() override { return false; }
   bool SupportSubTensorAlloc() override
   {
     // NOTE srcn allocator cannot support subtensor allocation yet
index 0e95720..e6c2235 100644 (file)
@@ -32,6 +32,8 @@ struct IConfig
 
   virtual std::string id() = 0;
   virtual void initialize() = 0;
+  // Support permute kernel
+  virtual bool SupportPermutation() = 0;
   // Support subtensor allocation
   virtual bool SupportSubTensorAlloc() = 0;
 
index 15185fa..b0065d3 100644 (file)
@@ -29,6 +29,7 @@ struct MockConfig : public IConfig
 {
   std::string id() override { return "b1"; }
   void initialize() override{};
+  bool SupportPermutation() override { return false; }
   bool SupportSubTensorAlloc() override { return false; }
 };
 
index 57aed27..cf82261 100644 (file)
@@ -57,6 +57,7 @@ struct MockConfigCPU : public IConfig
 {
   std::string id() override { return "cpu"; }
   void initialize() override{};
+  bool SupportPermutation() override { return false; }
   bool SupportSubTensorAlloc() override { return false; }
 };
 
@@ -75,6 +76,7 @@ struct MockConfigGPU : public IConfig
 {
   std::string id() override { return "gpu"; }
   void initialize() override{};
+  bool SupportPermutation() override { return false; }
   bool SupportSubTensorAlloc() override { return false; }
 };
 
@@ -93,6 +95,7 @@ struct MockConfigNPU : public IConfig
 {
   std::string id() override { return "npu"; }
   void initialize() override{};
+  bool SupportPermutation() override { return false; }
   bool SupportSubTensorAlloc() override { return false; }
 };