ArmNN
 21.08
TestNameAndDescriptorLayerVisitor.cpp File Reference
#include "TestNameAndDescriptorLayerVisitor.hpp"
#include "Network.hpp"
#include <armnn/Exceptions.hpp>
#include <doctest/doctest.h>

Go to the source code of this file.

Macros

#define TEST_CASE_CHECK_LAYER_VISITOR_NAME_AND_DESCRIPTOR(name, testName)
 
#define TEST_CASE_CHECK_LAYER_VISITOR_NAME_NULLPTR_AND_DESCRIPTOR(name, testName)
 

Functions

 TEST_SUITE ("TestNameAndDescriptorLayerVisitor")
 

Macro Definition Documentation

◆ TEST_CASE_CHECK_LAYER_VISITOR_NAME_AND_DESCRIPTOR

#define TEST_CASE_CHECK_LAYER_VISITOR_NAME_AND_DESCRIPTOR (   name,
  testName 
)
Value:
TEST_CASE(#testName) \
{ \
const char* layerName = "name##Layer"; \
armnn::name##Descriptor descriptor = GetDescriptor<armnn::name##Descriptor>(); \
Test##name##LayerVisitor visitor(descriptor, layerName); \
armnn::NetworkImpl net; \
armnn::IConnectableLayer *const layer = net.Add##name##Layer(descriptor, layerName); \
layer->Accept(visitor); \
}

Definition at line 15 of file TestNameAndDescriptorLayerVisitor.cpp.

Referenced by TEST_SUITE().

◆ TEST_CASE_CHECK_LAYER_VISITOR_NAME_NULLPTR_AND_DESCRIPTOR

#define TEST_CASE_CHECK_LAYER_VISITOR_NAME_NULLPTR_AND_DESCRIPTOR (   name,
  testName 
)
Value:
TEST_CASE(#testName) \
{ \
armnn::name##Descriptor descriptor = GetDescriptor<armnn::name##Descriptor>(); \
Test##name##LayerVisitor visitor(descriptor); \
armnn::NetworkImpl net; \
armnn::IConnectableLayer *const layer = net.Add##name##Layer(descriptor); \
layer->Accept(visitor); \
}

Definition at line 26 of file TestNameAndDescriptorLayerVisitor.cpp.

Referenced by TEST_SUITE().

Function Documentation

◆ TEST_SUITE()

TEST_SUITE ( "TestNameAndDescriptorLayerVisitor"  )

Definition at line 274 of file TestNameAndDescriptorLayerVisitor.cpp.

References armnn::Activation(), armnn::ArgMinMax(), armnn::BatchToSpaceNd(), armnn::DepthToSpace(), armnn::Fill(), armnn::Gather(), armnn::LogSoftmax(), armnn::Pad(), armnnUtils::Permute(), armnn::Pooling2d(), armnn::Resize(), armnn::Slice(), armnn::Softmax(), armnn::SpaceToBatchNd(), armnn::SpaceToDepth(), armnn::Splitter(), armnn::Stack(), armnn::StridedSlice(), TEST_CASE_CHECK_LAYER_VISITOR_NAME_AND_DESCRIPTOR, TEST_CASE_CHECK_LAYER_VISITOR_NAME_NULLPTR_AND_DESCRIPTOR, and armnnUtils::Transpose().

275 {
276 TEST_CASE_CHECK_LAYER_VISITOR_NAME_AND_DESCRIPTOR(Activation, CheckAdditionLayerVisitorNameAndDescriptor)
277 TEST_CASE_CHECK_LAYER_VISITOR_NAME_AND_DESCRIPTOR(ArgMinMax, CheckArgMinMaxLayerVisitorNameAndDescriptor)
278 TEST_CASE_CHECK_LAYER_VISITOR_NAME_AND_DESCRIPTOR(DepthToSpace, CheckDepthToSpaceLayerVisitorNameAndDescriptor)
279 TEST_CASE_CHECK_LAYER_VISITOR_NAME_AND_DESCRIPTOR(BatchToSpaceNd, CheckBatchToSpaceNdLayerVisitorNameAndDescriptor)
280 TEST_CASE_CHECK_LAYER_VISITOR_NAME_AND_DESCRIPTOR(Comparison, CheckComparisonLayerVisitorNameAndDescriptor)
281 TEST_CASE_CHECK_LAYER_VISITOR_NAME_AND_DESCRIPTOR(Concat, CheckConcatLayerVisitorNameAndDescriptor)
282 TEST_CASE_CHECK_LAYER_VISITOR_NAME_AND_DESCRIPTOR(ElementwiseUnary, CheckElementwiseUnaryLayerVisitorNameAndDescriptor)
283 TEST_CASE_CHECK_LAYER_VISITOR_NAME_AND_DESCRIPTOR(Fill, CheckFillLayerVisitorNameAndDescriptor)
284 TEST_CASE_CHECK_LAYER_VISITOR_NAME_AND_DESCRIPTOR(Gather, CheckGatherLayerVisitorNameAndDescriptor)
286  CheckInstanceNormalizationLayerVisitorNameAndDescriptor)
287 TEST_CASE_CHECK_LAYER_VISITOR_NAME_AND_DESCRIPTOR(L2Normalization, CheckL2NormalizationLayerVisitorNameAndDescriptor)
288 TEST_CASE_CHECK_LAYER_VISITOR_NAME_AND_DESCRIPTOR(LogicalBinary, CheckLogicalBinaruLayerVisitorNameAndDescriptor)
289 TEST_CASE_CHECK_LAYER_VISITOR_NAME_AND_DESCRIPTOR(LogSoftmax, CheckLogSoftmaxLayerVisitorNameAndDescriptor)
290 TEST_CASE_CHECK_LAYER_VISITOR_NAME_AND_DESCRIPTOR(Mean, CheckMeanLayerVisitorNameAndDescriptor)
291 TEST_CASE_CHECK_LAYER_VISITOR_NAME_AND_DESCRIPTOR(Normalization, CheckNormalizationLayerVisitorNameAndDescriptor)
292 TEST_CASE_CHECK_LAYER_VISITOR_NAME_AND_DESCRIPTOR(Pad, CheckPadLayerVisitorNameAndDescriptor)
293 TEST_CASE_CHECK_LAYER_VISITOR_NAME_AND_DESCRIPTOR(Permute, CheckPermuteLayerVisitorNameAndDescriptor)
294 TEST_CASE_CHECK_LAYER_VISITOR_NAME_AND_DESCRIPTOR(Pooling2d, CheckPooling2dLayerVisitorNameAndDescriptor)
295 TEST_CASE_CHECK_LAYER_VISITOR_NAME_AND_DESCRIPTOR(Reshape, CheckReshapeLayerVisitorNameAndDescriptor)
296 TEST_CASE_CHECK_LAYER_VISITOR_NAME_AND_DESCRIPTOR(Resize, CheckResizeLayerVisitorNameAndDescriptor)
297 TEST_CASE_CHECK_LAYER_VISITOR_NAME_AND_DESCRIPTOR(Slice, CheckSliceLayerVisitorNameAndDescriptor)
298 TEST_CASE_CHECK_LAYER_VISITOR_NAME_AND_DESCRIPTOR(Softmax, CheckSoftmaxLayerVisitorNameAndDescriptor)
299 TEST_CASE_CHECK_LAYER_VISITOR_NAME_AND_DESCRIPTOR(SpaceToBatchNd, CheckSpaceToBatchNdLayerVisitorNameAndDescriptor)
300 TEST_CASE_CHECK_LAYER_VISITOR_NAME_AND_DESCRIPTOR(SpaceToDepth, CheckSpaceToDepthLayerVisitorNameAndDescriptor)
301 TEST_CASE_CHECK_LAYER_VISITOR_NAME_AND_DESCRIPTOR(Splitter, CheckSplitterLayerVisitorNameAndDescriptor)
302 TEST_CASE_CHECK_LAYER_VISITOR_NAME_AND_DESCRIPTOR(Stack, CheckStackLayerVisitorNameAndDescriptor)
303 TEST_CASE_CHECK_LAYER_VISITOR_NAME_AND_DESCRIPTOR(StridedSlice, CheckStridedSliceLayerVisitorNameAndDescriptor)
304 TEST_CASE_CHECK_LAYER_VISITOR_NAME_AND_DESCRIPTOR(Transpose, CheckTransposeLayerVisitorNameAndDescriptor)
305 
307  CheckAdditionLayerVisitorNameNullptrAndDescriptor)
309  CheckArgMinMaxLayerVisitorNameNullptrAndDescriptor)
311  CheckDepthToSpaceLayerVisitorNameNullptrAndDescriptor)
313  CheckBatchToSpaceNdLayerVisitorNameNullptrAndDescriptor)
315  CheckComparisonLayerVisitorNameNullptrAndDescriptor)
317  CheckConcatLayerVisitorNameNullptrAndDescriptor)
319  CheckElementwiseUnaryLayerVisitorNameNullptrAndDescriptor)
321  CheckFillLayerVisitorNameNullptrAndDescriptor)
323  CheckGatherLayerVisitorNameNullptrAndDescriptor)
325  CheckInstanceNormalizationLayerVisitorNameNullptrAndDescriptor)
327  CheckL2NormalizationLayerVisitorNameNullptrAndDescriptor)
329  CheckLogicalBinaruLayerVisitorNameNullptrAndDescriptor)
331  CheckLogSoftmaxLayerVisitorNameNullptrAndDescriptor)
333  CheckMeanLayerVisitorNameNullptrAndDescriptor)
335  CheckNormalizationLayerVisitorNameNullptrAndDescriptor)
337  CheckPadLayerVisitorNameNullptrAndDescriptor)
339  CheckPermuteLayerVisitorNameNullptrAndDescriptor)
341  CheckPooling2dLayerVisitorNameNullptrAndDescriptor)
343  CheckReshapeLayerVisitorNameNullptrAndDescriptor)
345  CheckResizeLayerVisitorNameNullptrAndDescriptor)
347  CheckSliceLayerVisitorNameNullptrAndDescriptor)
349  CheckSoftmaxLayerVisitorNameNullptrAndDescriptor)
351  CheckSpaceToBatchNdLayerVisitorNameNullptrAndDescriptor)
353  CheckSpaceToDepthLayerVisitorNameNullptrAndDescriptor)
355  CheckSplitterLayerVisitorNameNullptrAndDescriptor)
357  CheckStackLayerVisitorNameNullptrAndDescriptor)
359  CheckStridedSliceLayerVisitorNameNullptrAndDescriptor)
361  CheckTransposeLayerVisitorNameNullptrAndDescriptor)
362 
363 }
void Slice(const TensorInfo &inputInfo, const SliceDescriptor &descriptor, const void *inputData, void *outputData, unsigned int dataTypeSize)
Definition: Slice.cpp:14
void Splitter(const SplitterQueueDescriptor &data, std::vector< ITensorHandle *> inputs, std::vector< ITensorHandle *> outputs)
Definition: Splitter.hpp:17
void Stack(const StackQueueDescriptor &data, std::vector< std::unique_ptr< Decoder< float >>> &inputs, Encoder< float > &output, const TensorInfo &inputInfo, const TensorInfo &outputInfo)
Definition: Stack.cpp:12
#define TEST_CASE_CHECK_LAYER_VISITOR_NAME_AND_DESCRIPTOR(name, testName)
void Fill(Encoder< float > &output, const TensorShape &desiredOutputShape, const float value)
Creates a tensor and fills it with a scalar value.
Definition: Fill.cpp:13
void Transpose(const armnn::TensorShape &dstShape, const armnn::PermutationVector &mappings, const void *src, void *dst, size_t dataTypeSize)
Definition: Transpose.cpp:120
void DepthToSpace(const TensorInfo &inputInfo, const DepthToSpaceDescriptor &descriptor, const void *inputData, void *outputData, unsigned int dataTypeSize)
void ArgMinMax(Decoder< float > &in, OUT *out, const TensorInfo &inputTensorInfo, const TensorInfo &outputTensorInfo, ArgMinMaxFunction function, int axis)
Definition: ArgMinMax.cpp:16
#define TEST_CASE_CHECK_LAYER_VISITOR_NAME_NULLPTR_AND_DESCRIPTOR(name, testName)
void Permute(const armnn::TensorShape &dstShape, const armnn::PermutationVector &mappings, const void *src, void *dst, size_t dataTypeSize)
Definition: Permute.cpp:131
void Gather(const TensorInfo &paramsInfo, const TensorInfo &indicesInfo, const TensorInfo &outputInfo, Decoder< float > &params, const int32_t *indices, Encoder< float > &output, const int32_t axis)
Definition: Gather.cpp:17
float Activation(float in, ActivationFunction function, float a, float b)
Definition: Activation.cpp:13
void Pad(const TensorInfo &inputInfo, const TensorInfo &outputInfo, const ITensorHandle *inputHandle, ITensorHandle *outputHandle, const PadQueueDescriptor &data)
Definition: Pad.cpp:39
void LogSoftmax(Decoder< float > &input, Encoder< float > &output, const TensorInfo &inputInfo, const LogSoftmaxDescriptor &descriptor)
Definition: LogSoftmax.cpp:29
void SpaceToBatchNd(const TensorInfo &inputInfo, const TensorInfo &outputInfo, const SpaceToBatchNdDescriptor &params, Decoder< float > &inputData, Encoder< float > &outputData)
void StridedSlice(const TensorInfo &inputInfo, const StridedSliceDescriptor &params, const void *inputData, void *outputData, unsigned int dataTypeSize)
void SpaceToDepth(const TensorInfo &inputInfo, const TensorInfo &outputInfo, const SpaceToDepthDescriptor &params, Decoder< float > &inputData, Encoder< float > &outputData)
void BatchToSpaceNd(const DataLayoutIndexed &dataLayout, const TensorInfo &inputTensorInfo, const TensorInfo &outputTensorInfo, const std::vector< unsigned int > &blockShape, const std::vector< std::pair< unsigned int, unsigned int >> &cropsData, Decoder< float > &inputDecoder, Encoder< float > &outputEncoder)
void Pooling2d(Decoder< float > &rInputDecoder, Encoder< float > &rOutputEncoder, const TensorInfo &inputInfo, const TensorInfo &outputInfo, const Pooling2dDescriptor &params)
Computes the Pooling2d operation.
Definition: Pooling2d.cpp:142
void Softmax(Decoder< float > &in, Encoder< float > &out, const TensorInfo &inputTensorInfo, float beta, int axis)
Computes the softmax function on some inputs, into outputs, with a shape given by tensorInfo...
Definition: Softmax.cpp:17
void Resize(Decoder< float > &in, const TensorInfo &inputInfo, Encoder< float > &out, const TensorInfo &outputInfo, DataLayoutIndexed dataLayout, armnn::ResizeMethod resizeMethod, bool alignCorners, bool halfPixelCenters)
Definition: Resize.cpp:65