24.02.1
|
#include "arm_compute/core/Helpers.h"
#include "arm_compute/core/Types.h"
#include "arm_compute/core/utils/StringUtils.h"
#include "arm_compute/runtime/NEON/functions/NEDirectConvolutionLayer.h"
#include "arm_compute/runtime/Tensor.h"
#include "arm_compute/runtime/TensorAllocator.h"
#include "src/common/cpuinfo/CpuIsaInfo.h"
#include "src/cpu/kernels/CpuDirectConv2dKernel.h"
#include "tests/NEON/Accessor.h"
#include "tests/PaddingCalculator.h"
#include "tests/datasets/ShapeDatasets.h"
#include "tests/framework/Asserts.h"
#include "tests/framework/Macros.h"
#include "tests/framework/datasets/Datasets.h"
#include "tests/validation/Validation.h"
#include "tests/validation/fixtures/DirectConvolutionLayerFixture.h"
Go to the source code of this file.
Namespaces | |
arm_compute | |
Copyright (c) 2017-2024 Arm Limited. | |
arm_compute::test | |
arm_compute::test::validation | |
Typedefs | |
template<typename T > | |
using | NEDirectConvolutionLayerFixture = DirectConvolutionValidationFixture< Tensor, Accessor, NEDirectConvolutionLayer, T > |
template<typename T > | |
using | NEDirectConvolutionLayerMixedDataLayoutFixture = DirectConvolutionValidationFixture< Tensor, Accessor, NEDirectConvolutionLayer, T, true > |
Functions | |
TEST_CASE (NoBias, framework::DatasetMode::PRECOMMIT) | |
Check whether the configuration of a Direct Convolution layer with no bias leads to a successful execution. More... | |
DATA_TEST_CASE (KernelSelection, framework::DatasetMode::ALL, concat(combine(combine(framework::dataset::make("CpuExt", std::string("NEON")), framework::dataset::make("DataType", { DataType::F32 })), framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC })), combine(combine(framework::dataset::make("CpuExt", std::string("NEON")), framework::dataset::make("DataType", { DataType::F16 })), framework::dataset::make("DataLayout", { DataLayout::NCHW }))), cpu_ext, data_type, data_layout) | |
DATA_TEST_CASE (Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(zip(framework::dataset::make("InputInfo", { TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32), }), framework::dataset::make("WeightsInfo",{ TensorInfo(TensorShape(3U, 3U, 2U, 4U), 1, DataType::F16), TensorInfo(TensorShape(3U, 3U, 3U, 4U), 1, DataType::F32), TensorInfo(TensorShape(9U, 9U, 2U, 4U), 1, DataType::F32), TensorInfo(TensorShape(5U, 3U, 2U, 4U), 1, DataType::F32), TensorInfo(TensorShape(3U, 3U, 2U, 4U, 3U), 1, DataType::F32), TensorInfo(TensorShape(3U, 3U, 2U, 4U), 1, DataType::F32), TensorInfo(TensorShape(3U, 3U, 2U, 4U), 1, DataType::F32), TensorInfo(TensorShape(3U, 3U, 2U, 4U), 1, DataType::F32), TensorInfo(TensorShape(3U, 3U, 2U, 4U), 1, DataType::F32), })), framework::dataset::make("BiasesInfo",{ TensorInfo(TensorShape(4U), 1, DataType::F32), TensorInfo(TensorShape(4U), 1, DataType::F32), TensorInfo(TensorShape(4U), 1, DataType::F32), TensorInfo(TensorShape(4U), 1, DataType::F32), TensorInfo(TensorShape(4U), 1, DataType::F32), TensorInfo(TensorShape(4U), 1, DataType::F32), TensorInfo(TensorShape(3U), 1, DataType::F32), TensorInfo(TensorShape(4U, 2U), 1, DataType::F32), TensorInfo(TensorShape(4U), 1, DataType::F32), })), framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(25U, 11U, 4U), 1, DataType::F32), TensorInfo(TensorShape(25U, 11U, 4U), 1, DataType::F32), TensorInfo(TensorShape(25U, 11U, 4U), 1, DataType::F32), TensorInfo(TensorShape(25U, 11U, 4U), 1, DataType::F32), TensorInfo(TensorShape(25U, 11U, 4U), 1, DataType::F32), TensorInfo(TensorShape(25U, 11U, 4U), 1, DataType::F32), TensorInfo(TensorShape(25U, 11U, 4U), 1, DataType::F32), TensorInfo(TensorShape(25U, 11U, 4U), 1, DataType::F32), TensorInfo(TensorShape(26U, 11U, 4U), 1, DataType::F32), })), framework::dataset::make("ConvInfo", { PadStrideInfo(1, 1, 0, 0), PadStrideInfo(1, 1, 0, 0), PadStrideInfo(1, 1, 0, 0), PadStrideInfo(1, 1, 0, 0), PadStrideInfo(1, 1, 0, 0), PadStrideInfo(3, 3, 0, 0), PadStrideInfo(1, 1, 0, 0), PadStrideInfo(1, 1, 0, 0), PadStrideInfo(1, 1, 0, 0), })), framework::dataset::make("ActivationInfo", { ActivationLayerInfo(), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), ActivationLayerInfo(), ActivationLayerInfo(), ActivationLayerInfo(), ActivationLayerInfo(), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU), })), framework::dataset::make("Expected", { false, false, false, false, false, false, false, false, false })), input_info, weights_info, biases_info, output_info, conv_info, act_info, expected) | |
DATA_TEST_CASE (NoPaddingNHWCKernel, framework::DatasetMode::ALL, combine(combine(combine(data_precommit, framework::dataset::make("DataType", DataType::F32)), ActivationFunctionsDataset), framework::dataset::make("DataLayout", { DataLayout::NHWC })), shape, stride_x, stride_y, pad_x, pad_y, kernel_size, num_kernels, data_type, act_info, data_layout) | |
FIXTURE_DATA_TEST_CASE (RunSmall, NEDirectConvolutionLayerFixture< float >, framework::DatasetMode::PRECOMMIT, combine(combine(combine(data_precommit, framework::dataset::make("DataType", DataType::F32)), ActivationFunctionsDataset), framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) | |
FIXTURE_DATA_TEST_CASE (RunMixedDataLayout, NEDirectConvolutionLayerMixedDataLayoutFixture< float >, framework::DatasetMode::PRECOMMIT, combine(combine(combine(data_precommit, framework::dataset::make("DataType", DataType::F32)), ActivationFunctionsDataset), framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) | |
FIXTURE_DATA_TEST_CASE (RunSmall8x8, NEDirectConvolutionLayerFixture< float >, framework::DatasetMode::PRECOMMIT, combine(combine(combine(data_precommit8x8, framework::dataset::make("DataType", DataType::F32)), ActivationFunctionsDataset), framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) | |
FIXTURE_DATA_TEST_CASE (RunSmall9x9, NEDirectConvolutionLayerFixture< float >, framework::DatasetMode::PRECOMMIT, combine(combine(combine(data_precommit9x9, framework::dataset::make("DataType", DataType::F32)), ActivationFunctionsDataset), framework::dataset::make("DataLayout", { DataLayout::NHWC }))) | |
FIXTURE_DATA_TEST_CASE (RunLarge, NEDirectConvolutionLayerFixture< float >, framework::DatasetMode::NIGHTLY, combine(combine(combine(data_f32_nightly, framework::dataset::make("DataType", DataType::F32)), ActivationFunctionsDataset), framework::dataset::make("DataLayout", { DataLayout::NCHW, DataLayout::NHWC }))) | |
FIXTURE_DATA_TEST_CASE (RunLargeUsecase, NEDirectConvolutionLayerFixture< float >, framework::DatasetMode::NIGHTLY, combine(combine(combine(data_nightly_usecase, framework::dataset::make("DataType", DataType::F32)), framework::dataset::make("ActivationInfo", { ActivationLayerInfo() })), framework::dataset::make("DataLayout", { DataLayout::NHWC }))) | |