From 992d6dc57d8463729910b688f0fb5825d0d3ccf2 Mon Sep 17 00:00:00 2001 From: Matteo Martincigh Date: Thu, 10 Jan 2019 17:34:20 +0000 Subject: IVGCVSW-2454 Refactor ArmNN to support pluggable backends from a separate code base * Made the virtual functions in ILayerSupport.hpp pure * Created a LayerSupportBase class with the default implementation of the interface * Made the backend layer support classes inherit from the base class, instead of directly from the interface * Refactored the profiler and the profiling event classes to use the BackendId instead of the Compute * Implemented a proper MemCopy support method * Changed Compute to BackendId in the profiling API and objects * Removed static references to pluggable backends !android-nn-driver:492 Change-Id: Id6332b5f48c980819e0a09adc818d1effd057296 --- src/backends/reference/RefLayerSupport.cpp | 13 +++++++++++++ src/backends/reference/RefLayerSupport.hpp | 11 ++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) (limited to 'src/backends/reference') diff --git a/src/backends/reference/RefLayerSupport.cpp b/src/backends/reference/RefLayerSupport.cpp index 56d2e4c659..61a34f957e 100644 --- a/src/backends/reference/RefLayerSupport.cpp +++ b/src/backends/reference/RefLayerSupport.cpp @@ -390,6 +390,17 @@ bool RefLayerSupport::IsMergerSupported(const std::vector inp &TrueFunc<>); } +bool RefLayerSupport::IsMemCopySupported(const TensorInfo &input, + const TensorInfo &output, + Optional reasonIfUnsupported) const +{ + ignore_unused(output); + return IsSupportedForDataTypeRef(reasonIfUnsupported, + input.GetDataType(), + &TrueFunc<>, + &TrueFunc<>); +} + bool RefLayerSupport::IsMinimumSupported(const TensorInfo& input0, const TensorInfo& input1, const TensorInfo& output, @@ -478,8 +489,10 @@ bool RefLayerSupport::IsPooling2dSupported(const TensorInfo& input, } bool RefLayerSupport::IsReshapeSupported(const TensorInfo& input, + const ReshapeDescriptor& descriptor, Optional reasonIfUnsupported) const { + ignore_unused(descriptor); return IsSupportedForDataTypeRef(reasonIfUnsupported, input.GetDataType(), &TrueFunc<>, diff --git a/src/backends/reference/RefLayerSupport.hpp b/src/backends/reference/RefLayerSupport.hpp index 188faa84b6..5778806f00 100644 --- a/src/backends/reference/RefLayerSupport.hpp +++ b/src/backends/reference/RefLayerSupport.hpp @@ -4,12 +4,12 @@ // #pragma once -#include +#include namespace armnn { -class RefLayerSupport : public ILayerSupport +class RefLayerSupport : public LayerSupportBase { public: bool IsActivationSupported(const TensorInfo& input, @@ -93,7 +93,7 @@ public: bool IsGreaterSupported(const TensorInfo& input0, const TensorInfo& input1, - const TensorInfo& ouput, + const TensorInfo& output, Optional reasonIfUnsupported = EmptyOptional()) const override; bool IsInputSupported(const TensorInfo& input, @@ -146,6 +146,10 @@ public: const OriginsDescriptor& descriptor, Optional reasonIfUnsupported = EmptyOptional()) const override; + bool IsMemCopySupported(const TensorInfo& input, + const TensorInfo& output, + Optional reasonIfUnsupported = EmptyOptional()) const override; + bool IsMinimumSupported(const TensorInfo& input0, const TensorInfo& input1, const TensorInfo& output, @@ -180,6 +184,7 @@ public: Optional reasonIfUnsupported = EmptyOptional()) const override; bool IsReshapeSupported(const TensorInfo& input, + const ReshapeDescriptor& descriptor, Optional reasonIfUnsupported = EmptyOptional()) const override; bool IsResizeBilinearSupported(const TensorInfo& input, -- cgit v1.2.1