aboutsummaryrefslogtreecommitdiff
path: root/src/backends
diff options
context:
space:
mode:
Diffstat (limited to 'src/backends')
-rw-r--r--src/backends/backendsCommon/LayerSupportBase.cpp1
-rw-r--r--src/backends/backendsCommon/LayerSupportBase.hpp1
-rw-r--r--src/backends/backendsCommon/WorkloadData.hpp6
-rw-r--r--src/backends/backendsCommon/WorkloadFactory.cpp3
-rw-r--r--src/backends/backendsCommon/test/DebugTestImpl.hpp31
-rw-r--r--src/backends/backendsCommon/test/IsLayerSupportedTestImpl.hpp2
-rw-r--r--src/backends/reference/RefLayerSupport.cpp2
-rw-r--r--src/backends/reference/RefLayerSupport.hpp1
-rw-r--r--src/backends/reference/workloads/Debug.cpp24
-rw-r--r--src/backends/reference/workloads/Debug.hpp7
-rw-r--r--src/backends/reference/workloads/RefDebugWorkload.cpp2
11 files changed, 48 insertions, 32 deletions
diff --git a/src/backends/backendsCommon/LayerSupportBase.cpp b/src/backends/backendsCommon/LayerSupportBase.cpp
index 6358f6f0a8..c170ac05e2 100644
--- a/src/backends/backendsCommon/LayerSupportBase.cpp
+++ b/src/backends/backendsCommon/LayerSupportBase.cpp
@@ -100,7 +100,6 @@ bool LayerSupportBase::IsConvolution2dSupported(const TensorInfo& input,
bool LayerSupportBase::IsDebugSupported(const TensorInfo& input,
const TensorInfo& output,
- const DebugDescriptor& descriptor,
Optional<std::string&> reasonIfUnsupported) const
{
return DefaultLayerSupport(__func__, __FILE__, __LINE__, reasonIfUnsupported);
diff --git a/src/backends/backendsCommon/LayerSupportBase.hpp b/src/backends/backendsCommon/LayerSupportBase.hpp
index bf81459582..75c366cf3b 100644
--- a/src/backends/backendsCommon/LayerSupportBase.hpp
+++ b/src/backends/backendsCommon/LayerSupportBase.hpp
@@ -58,7 +58,6 @@ public:
bool IsDebugSupported(const TensorInfo& input,
const TensorInfo& output,
- const DebugDescriptor& descriptor,
Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override;
bool IsDepthwiseConvolutionSupported(const TensorInfo& input,
diff --git a/src/backends/backendsCommon/WorkloadData.hpp b/src/backends/backendsCommon/WorkloadData.hpp
index 09f56479cd..18bd921d5e 100644
--- a/src/backends/backendsCommon/WorkloadData.hpp
+++ b/src/backends/backendsCommon/WorkloadData.hpp
@@ -380,9 +380,13 @@ struct GreaterQueueDescriptor : QueueDescriptor
void Validate(const WorkloadInfo& workloadInfo) const;
};
-struct DebugQueueDescriptor : QueueDescriptorWithParameters<DebugDescriptor>
+struct DebugQueueDescriptor : QueueDescriptor
{
void Validate(const WorkloadInfo& workloadInfo) const;
+
+ LayerGuid m_Guid;
+ std::string m_LayerName;
+ unsigned int m_SlotIndex;
};
struct RsqrtQueueDescriptor : QueueDescriptor
diff --git a/src/backends/backendsCommon/WorkloadFactory.cpp b/src/backends/backendsCommon/WorkloadFactory.cpp
index 72d0b19d04..0996a8aaee 100644
--- a/src/backends/backendsCommon/WorkloadFactory.cpp
+++ b/src/backends/backendsCommon/WorkloadFactory.cpp
@@ -192,14 +192,11 @@ bool IWorkloadFactory::IsLayerSupported(const BackendId& backendId,
}
case LayerType::Debug:
{
- auto cLayer = boost::polymorphic_downcast<const DebugLayer*>(&layer);
-
const TensorInfo& input = layer.GetInputSlot(0).GetConnection()->GetTensorInfo();
const TensorInfo& output = layer.GetOutputSlot(0).GetTensorInfo();
result = layerSupportObject->IsDebugSupported(OverrideDataType(input, dataType),
OverrideDataType(output, dataType),
- cLayer->GetParameters(),
reason);
break;
}
diff --git a/src/backends/backendsCommon/test/DebugTestImpl.hpp b/src/backends/backendsCommon/test/DebugTestImpl.hpp
index 14808f4856..4af479d7ce 100644
--- a/src/backends/backendsCommon/test/DebugTestImpl.hpp
+++ b/src/backends/backendsCommon/test/DebugTestImpl.hpp
@@ -92,8 +92,9 @@ LayerTestResult<T, 4> Debug4DTest(
unsigned int outputShape[] = {1, 2, 2, 3};
armnn::DebugQueueDescriptor desc;
- desc.m_Parameters.m_LayerName = "TestOutput";
- desc.m_Parameters.m_SlotIndex = 1;
+ desc.m_Guid = 1;
+ desc.m_LayerName = "TestOutput";
+ desc.m_SlotIndex = 0;
inputTensorInfo = armnn::TensorInfo(4, inputShape, ArmnnType);
outputTensorInfo = armnn::TensorInfo(4, outputShape, ArmnnType);
@@ -115,8 +116,9 @@ LayerTestResult<T, 4> Debug4DTest(
});
const std::string expectedStringOutput =
- "{ \"layer\": \"TestOutput\","
- " \"outputSlot\": 1,"
+ "{ \"layerGuid\": 1,"
+ " \"layerName\": \"TestOutput\","
+ " \"outputSlot\": 0,"
" \"shape\": [1, 2, 2, 3],"
" \"min\": 1, \"max\": 12,"
" \"data\": [[[[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [10, 11, 12]]]] }\n";
@@ -143,7 +145,9 @@ LayerTestResult<T, 3> Debug3DTest(
unsigned int outputShape[] = {3, 3, 1};
armnn::DebugQueueDescriptor desc;
- desc.m_Parameters.m_LayerName = "TestOutput";
+ desc.m_Guid = 1;
+ desc.m_LayerName = "TestOutput";
+ desc.m_SlotIndex = 0;
inputTensorInfo = armnn::TensorInfo(3, inputShape, ArmnnType);
outputTensorInfo = armnn::TensorInfo(3, outputShape, ArmnnType);
@@ -163,7 +167,8 @@ LayerTestResult<T, 3> Debug3DTest(
});
const std::string expectedStringOutput =
- "{ \"layer\": \"TestOutput\","
+ "{ \"layerGuid\": 1,"
+ " \"layerName\": \"TestOutput\","
" \"outputSlot\": 0,"
" \"shape\": [3, 3, 1],"
" \"min\": 1, \"max\": 9,"
@@ -191,7 +196,9 @@ LayerTestResult<T, 2> Debug2DTest(
unsigned int outputShape[] = {2, 2};
armnn::DebugQueueDescriptor desc;
- desc.m_Parameters.m_LayerName = "TestOutput";
+ desc.m_Guid = 1;
+ desc.m_LayerName = "TestOutput";
+ desc.m_SlotIndex = 0;
inputTensorInfo = armnn::TensorInfo(2, inputShape, ArmnnType);
outputTensorInfo = armnn::TensorInfo(2, outputShape, ArmnnType);
@@ -209,7 +216,8 @@ LayerTestResult<T, 2> Debug2DTest(
});
const std::string expectedStringOutput =
- "{ \"layer\": \"TestOutput\","
+ "{ \"layerGuid\": 1,"
+ " \"layerName\": \"TestOutput\","
" \"outputSlot\": 0,"
" \"shape\": [2, 2],"
" \"min\": 1, \"max\": 4,"
@@ -237,7 +245,9 @@ LayerTestResult<T, 1> Debug1DTest(
unsigned int outputShape[] = {4};
armnn::DebugQueueDescriptor desc;
- desc.m_Parameters.m_LayerName = "TestOutput";
+ desc.m_Guid = 1;
+ desc.m_LayerName = "TestOutput";
+ desc.m_SlotIndex = 0;
inputTensorInfo = armnn::TensorInfo(1, inputShape, ArmnnType);
outputTensorInfo = armnn::TensorInfo(1, outputShape, ArmnnType);
@@ -253,7 +263,8 @@ LayerTestResult<T, 1> Debug1DTest(
});
const std::string expectedStringOutput =
- "{ \"layer\": \"TestOutput\","
+ "{ \"layerGuid\": 1,"
+ " \"layerName\": \"TestOutput\","
" \"outputSlot\": 0,"
" \"shape\": [4],"
" \"min\": 1, \"max\": 4,"
diff --git a/src/backends/backendsCommon/test/IsLayerSupportedTestImpl.hpp b/src/backends/backendsCommon/test/IsLayerSupportedTestImpl.hpp
index 3df71830ca..79213c18e0 100644
--- a/src/backends/backendsCommon/test/IsLayerSupportedTestImpl.hpp
+++ b/src/backends/backendsCommon/test/IsLayerSupportedTestImpl.hpp
@@ -332,7 +332,7 @@ DECLARE_LAYER_POLICY_2_PARAM(Convolution2d)
DECLARE_LAYER_POLICY_1_PARAM(MemCopy)
-DECLARE_LAYER_POLICY_2_PARAM(Debug)
+DECLARE_LAYER_POLICY_1_PARAM(Debug)
DECLARE_LAYER_POLICY_2_PARAM(DepthwiseConvolution2d)
diff --git a/src/backends/reference/RefLayerSupport.cpp b/src/backends/reference/RefLayerSupport.cpp
index d89e548323..820f36b7ac 100644
--- a/src/backends/reference/RefLayerSupport.cpp
+++ b/src/backends/reference/RefLayerSupport.cpp
@@ -354,11 +354,9 @@ bool RefLayerSupport::IsConvolution2dSupported(const TensorInfo& input,
bool RefLayerSupport::IsDebugSupported(const TensorInfo& input,
const TensorInfo& output,
- const DebugDescriptor& descriptor,
Optional<std::string&> reasonIfUnsupported) const
{
ignore_unused(output);
- ignore_unused(descriptor);
return IsSupportedForDataTypeRef(reasonIfUnsupported,
input.GetDataType(),
&TrueFunc<>,
diff --git a/src/backends/reference/RefLayerSupport.hpp b/src/backends/reference/RefLayerSupport.hpp
index 3b73f22927..c0d7fcf4aa 100644
--- a/src/backends/reference/RefLayerSupport.hpp
+++ b/src/backends/reference/RefLayerSupport.hpp
@@ -56,7 +56,6 @@ public:
bool IsDebugSupported(const TensorInfo& input,
const TensorInfo& output,
- const DebugDescriptor& descriptor,
Optional<std::string&> reasonIfUnsupported = EmptyOptional()) const override;
bool IsDepthwiseConvolutionSupported(const TensorInfo& input,
diff --git a/src/backends/reference/workloads/Debug.cpp b/src/backends/reference/workloads/Debug.cpp
index cc83c7b4ee..b263db67cf 100644
--- a/src/backends/reference/workloads/Debug.cpp
+++ b/src/backends/reference/workloads/Debug.cpp
@@ -16,9 +16,11 @@ namespace armnn
template <typename T>
void Debug(const TensorInfo& inputInfo,
const TensorInfo& outputInfo,
- const DebugDescriptor& descriptor,
const T* inputData,
- T* outputData)
+ T* outputData,
+ LayerGuid guid,
+ const std::string& layerName,
+ unsigned int slotIndex)
{
const unsigned int numDims = inputInfo.GetNumDimensions();
const unsigned int numElements = inputInfo.GetNumElements();
@@ -33,8 +35,9 @@ void Debug(const TensorInfo& inputInfo,
}
std::cout << "{ ";
- std::cout << "\"layer\": \"" << descriptor.m_LayerName << "\", ";
- std::cout << "\"outputSlot\": " << descriptor.m_SlotIndex << ", ";
+ std::cout << "\"layerGuid\": " << guid << ", ";
+ std::cout << "\"layerName\": \"" << layerName << "\", ";
+ std::cout << "\"outputSlot\": " << slotIndex << ", ";
std::cout << "\"shape\": ";
std::cout << "[";
@@ -89,13 +92,18 @@ void Debug(const TensorInfo& inputInfo,
template void Debug<float>(const TensorInfo& inputInfo,
const TensorInfo& outputInfo,
- const DebugDescriptor& descriptor,
const float* inputData,
- float* outputData);
+ float* outputData,
+ LayerGuid guid,
+ const std::string& layerName,
+ unsigned int slotIndex);
template void Debug<uint8_t>(const TensorInfo& inputInfo,
const TensorInfo& outputInfo,
- const DebugDescriptor& descriptor,
const uint8_t* inputData,
- uint8_t* outputData);
+ uint8_t* outputData,
+ LayerGuid guid,
+ const std::string& layerName,
+ unsigned int slotIndex);
+
} // namespace armnn
diff --git a/src/backends/reference/workloads/Debug.hpp b/src/backends/reference/workloads/Debug.hpp
index 682f0bd31b..29a7d40662 100644
--- a/src/backends/reference/workloads/Debug.hpp
+++ b/src/backends/reference/workloads/Debug.hpp
@@ -4,7 +4,6 @@
//
#pragma once
-#include <armnn/Descriptors.hpp>
#include <armnn/Tensor.hpp>
namespace armnn
@@ -13,8 +12,10 @@ namespace armnn
template <typename T>
void Debug(const TensorInfo& inputInfo,
const TensorInfo& outputInfo,
- const DebugDescriptor& descriptor,
const T* inputData,
- T* outputData);
+ T* outputData,
+ LayerGuid guid,
+ const std::string& layerName,
+ unsigned int slotIndex);
} //namespace armnn
diff --git a/src/backends/reference/workloads/RefDebugWorkload.cpp b/src/backends/reference/workloads/RefDebugWorkload.cpp
index d9a47c0596..412d399adc 100644
--- a/src/backends/reference/workloads/RefDebugWorkload.cpp
+++ b/src/backends/reference/workloads/RefDebugWorkload.cpp
@@ -25,7 +25,7 @@ void RefDebugWorkload<DataType>::Execute() const
const T* inputData = GetInputTensorData<T>(0, m_Data);
T* outputData = GetOutputTensorData<T>(0, m_Data);
- Debug(inputInfo, outputInfo, m_Data.m_Parameters, inputData, outputData);
+ Debug(inputInfo, outputInfo, inputData, outputData, m_Data.m_Guid, m_Data.m_LayerName, m_Data.m_SlotIndex);
}
template class RefDebugWorkload<DataType::Float32>;