From 80943253e63779b61412264ff4c58b406cf061ae Mon Sep 17 00:00:00 2001 From: Michalis Spyrou Date: Thu, 10 Jan 2019 17:19:50 +0000 Subject: COMPMID-1652 CL Cleanup and add missing tests Change-Id: I359cc0fd0c3fa42ab10a770e59d58704403889b2 Reviewed-on: https://review.mlplatform.org/498 Tested-by: Arm Jenkins Reviewed-by: Michele Di Giorgio Reviewed-by: Isabella Gottardi --- tests/validation/CL/Transpose.cpp | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) (limited to 'tests/validation/CL/Transpose.cpp') diff --git a/tests/validation/CL/Transpose.cpp b/tests/validation/CL/Transpose.cpp index b23aff4645..d60e895884 100644 --- a/tests/validation/CL/Transpose.cpp +++ b/tests/validation/CL/Transpose.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 ARM Limited. + * Copyright (c) 2017-2019 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -44,7 +44,31 @@ namespace validation TEST_SUITE(CL) TEST_SUITE(Transpose) -DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(concat(datasets::Small2DShapes(), datasets::Large2DShapes()), framework::dataset::make("DataType", { DataType::S8, DataType::U8, DataType::S16, DataType::U16, DataType::U32, DataType::S32, DataType::F16, DataType::F32 })), +// *INDENT-OFF* +// clang-format off +DATA_TEST_CASE(Validate, framework::DatasetMode::ALL, zip(zip( + framework::dataset::make("InputInfo", { TensorInfo(TensorShape(21U, 13U), 1, DataType::U8), // Input not a multiple of 8 + TensorInfo(TensorShape(21U, 13U), 1, DataType::U16), // Invalid shape + TensorInfo(TensorShape(20U, 13U), 1, DataType::U32), // Window shrink + TensorInfo(TensorShape(20U, 13U), 1, DataType::U8), // Wrong data type + TensorInfo(TensorShape(20U, 16U), 1, DataType::U32), // Valid + }), + framework::dataset::make("OutputInfo",{ TensorInfo(TensorShape(13U, 21U), 1, DataType::U8), + TensorInfo(TensorShape(21U, 13U), 1, DataType::U16), + TensorInfo(TensorShape(13U, 20U), 1, DataType::U32), + TensorInfo(TensorShape(31U, 20U), 1, DataType::U16), + TensorInfo(TensorShape(16U, 20U), 1, DataType::U32), + })), + framework::dataset::make("Expected", { false, false, false, false, true })), + a_info, output_info, expected) +{ + // Lock tensors + ARM_COMPUTE_EXPECT(bool(CLTranspose::validate(&a_info.clone()->set_is_resizable(false), &output_info.clone()->set_is_resizable(false))) == expected, framework::LogLevel::ERRORS); +} +// clang-format on +// *INDENT-ON* + +DATA_TEST_CASE(Configuration, framework::DatasetMode::ALL, combine(datasets::Small2DShapes(), framework::dataset::make("DataType", { DataType::S8, DataType::U8, DataType::S16, DataType::U16, DataType::U32, DataType::S32, DataType::F16, DataType::F32 })), shape, data_type) { // Make rows the columns of the original shape @@ -81,7 +105,7 @@ FIXTURE_DATA_TEST_CASE(RunLarge, CLTransposeFixture, framework::Dataset // Validate output validate(CLAccessor(_target), _reference); } -TEST_SUITE_END() +TEST_SUITE_END() // U8 TEST_SUITE(U16) FIXTURE_DATA_TEST_CASE(RunSmall, CLTransposeFixture, framework::DatasetMode::PRECOMMIT, combine(concat(datasets::Small1DShapes(), datasets::Small2DShapes()), @@ -96,7 +120,7 @@ FIXTURE_DATA_TEST_CASE(RunLarge, CLTransposeFixture, framework::Datase // Validate output validate(CLAccessor(_target), _reference); } -TEST_SUITE_END() +TEST_SUITE_END() // U16 TEST_SUITE(U32) FIXTURE_DATA_TEST_CASE(RunSmall, CLTransposeFixture, framework::DatasetMode::PRECOMMIT, combine(concat(datasets::Small1DShapes(), datasets::Small2DShapes()), @@ -111,10 +135,10 @@ FIXTURE_DATA_TEST_CASE(RunLarge, CLTransposeFixture, framework::Datase // Validate output validate(CLAccessor(_target), _reference); } -TEST_SUITE_END() +TEST_SUITE_END() // U32 -TEST_SUITE_END() -TEST_SUITE_END() +TEST_SUITE_END() // Transpose +TEST_SUITE_END() // CL } // namespace validation } // namespace test } // namespace arm_compute -- cgit v1.2.1