aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/CL/DirectConvolutionLayer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/validation/CL/DirectConvolutionLayer.cpp')
-rw-r--r--tests/validation/CL/DirectConvolutionLayer.cpp67
1 files changed, 67 insertions, 0 deletions
diff --git a/tests/validation/CL/DirectConvolutionLayer.cpp b/tests/validation/CL/DirectConvolutionLayer.cpp
index 2986369d9b..08d53d5af3 100644
--- a/tests/validation/CL/DirectConvolutionLayer.cpp
+++ b/tests/validation/CL/DirectConvolutionLayer.cpp
@@ -79,6 +79,73 @@ TEST_SUITE(DirectConvolutionLayer)
//TODO(COMPMID-415): Configuration tests?
+// *INDENT-OFF*
+// clang-format off
+DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip(zip(zip(zip(
+ framework::dataset::make("InputInfo", { TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32, 0), // Mismatching data type input/weights
+ TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32, 0), // Mismatching input feature maps
+ TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32, 0), // Unsupported kernel width
+ TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32, 0), // Non-rectangular weights dimensions
+ TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32, 0), // Invalid weights dimensions
+ TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32, 0), // Invalid stride
+ TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32, 0), // Invalid biases size
+ TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32, 0), // Invalid biases dimensions
+ TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32, 0), // Invalid output size
+ TensorInfo(TensorShape(27U, 13U, 2U), 1, DataType::F32, 0),
+ }),
+ framework::dataset::make("WeightsInfo",{ TensorInfo(TensorShape(3U, 3U, 2U, 4U), 1, DataType::F16, 0),
+ TensorInfo(TensorShape(3U, 3U, 3U, 4U), 1, DataType::F32, 0),
+ TensorInfo(TensorShape(9U, 9U, 2U, 4U), 1, DataType::F32, 0),
+ TensorInfo(TensorShape(5U, 3U, 2U, 4U), 1, DataType::F32, 0),
+ TensorInfo(TensorShape(3U, 3U, 2U, 4U, 3U), 1, DataType::F32, 0),
+ TensorInfo(TensorShape(3U, 3U, 2U, 4U), 1, DataType::F32, 0),
+ TensorInfo(TensorShape(3U, 3U, 2U, 4U), 1, DataType::F32, 0),
+ TensorInfo(TensorShape(3U, 3U, 2U, 4U), 1, DataType::F32, 0),
+ TensorInfo(TensorShape(3U, 3U, 2U, 4U), 1, DataType::F32, 0),
+ TensorInfo(TensorShape(3U, 3U, 2U, 4U), 1, DataType::F32, 0),
+ })),
+ framework::dataset::make("BiasesInfo",{ TensorInfo(TensorShape(4U), 1, DataType::F32, 0),
+ TensorInfo(TensorShape(4U), 1, DataType::F32, 0),
+ TensorInfo(TensorShape(4U), 1, DataType::F32, 0),
+ TensorInfo(TensorShape(4U), 1, DataType::F32, 0),
+ TensorInfo(TensorShape(4U), 1, DataType::F32, 0),
+ TensorInfo(TensorShape(4U), 1, DataType::F32, 0),
+ TensorInfo(TensorShape(3U), 1, DataType::F32, 0),
+ TensorInfo(TensorShape(4U, 2U), 1, DataType::F32, 0),
+ TensorInfo(TensorShape(4U), 1, DataType::F32, 0),
+ TensorInfo(TensorShape(4U), 1, DataType::F32, 0),
+ })),
+ framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(25U, 11U, 4U), 1, DataType::F32, 0),
+ TensorInfo(TensorShape(25U, 11U, 4U), 1, DataType::F32, 0),
+ TensorInfo(TensorShape(25U, 11U, 4U), 1, DataType::F32, 0),
+ TensorInfo(TensorShape(25U, 11U, 4U), 1, DataType::F32, 0),
+ TensorInfo(TensorShape(25U, 11U, 4U), 1, DataType::F32, 0),
+ TensorInfo(TensorShape(25U, 11U, 4U), 1, DataType::F32, 0),
+ TensorInfo(TensorShape(25U, 11U, 4U), 1, DataType::F32, 0),
+ TensorInfo(TensorShape(25U, 11U, 4U), 1, DataType::F32, 0),
+ TensorInfo(TensorShape(26U, 11U, 4U), 1, DataType::F32, 0),
+ TensorInfo(TensorShape(25U, 11U, 4U), 1, DataType::F32, 0),
+ })),
+ 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),
+ PadStrideInfo(1, 1, 0, 0),
+ })),
+ framework::dataset::make("Expected", { true, true, true, true, true, true, true, true, true, false })),
+ input_info, weights_info, biases_info, output_info, conv_info, expected)
+{
+ bool is_error = bool(CLDirectConvolutionLayer::validate(&input_info, &weights_info, &biases_info, &output_info, conv_info));
+ ARM_COMPUTE_EXPECT(is_error == expected, framework::LogLevel::ERRORS);
+}
+// clang-format on
+// *INDENT-ON*
+
template <typename T>
using CLDirectConvolutionLayerFixture = DirectConvolutionValidationFixture<CLTensor, CLAccessor, CLDirectConvolutionLayer, T>;