COMPMID-1858: Fix boundary check in gemm_reshape_rhs_matrix_t and gemm_reshape_rhs_matrix_nt

Change-Id: Ic935f1947f3f3a60455a8108fcf6f313258abe51
Reviewed-on: https://review.mlplatform.org/425
Tested-by: Anthony Barbier <Anthony.barbier@arm.com>
Reviewed-by: Manuel Bottini <manuel.bottini@arm.com>
Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
diff --git a/tests/validation/CL/GEMMReshapeRHSMatrix.cpp b/tests/validation/CL/GEMMReshapeRHSMatrix.cpp
index e886b7b..f2627ac 100644
--- a/tests/validation/CL/GEMMReshapeRHSMatrix.cpp
+++ b/tests/validation/CL/GEMMReshapeRHSMatrix.cpp
@@ -52,8 +52,23 @@
 /** Batch size values to test */
 const auto b_values = framework::dataset::make("batchsize", 1, 3);
 
-/** N0 values to test */
-const auto n0_values = framework::dataset::make("N0", { 2, 4, 8, 16 });
+/** N0 values to test - Precommit */
+const auto n0_values_precommit = framework::dataset::make("N0", { 2, 4 });
+
+/** N0 values to test - Nightly */
+const auto n0_values_nightly = framework::dataset::make("N0", { 2, 4, 8, 16 });
+
+/** K0 values to test (transpose=true) - Precommit */
+const auto k0_t_values_precommit = framework::dataset::make("K0", { 4 });
+
+/** K0 values to test (transpose=true) - Nightly */
+const auto k0_t_values_nightly = framework::dataset::make("K0", { 4, 8, 16 });
+
+/** K0 values to test (transpose=false) - Precommit */
+const auto k0_nt_values_precommit = framework::dataset::make("K0", { 1, 2, 4 });
+
+/** K0 values to test (transpose=false) - Nightly */
+const auto k0_nt_values_nightly = framework::dataset::make("K0", { 1, 2, 4, 8, 16 });
 
 /** H0 values to test */
 const auto h0_values = framework::dataset::make("H0", 1, 4);
@@ -78,8 +93,8 @@
 DATA_TEST_CASE(Configuration0, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(datasets::SmallGEMMReshape2DShapes(),
                                                                    b_values),
                                                                    data_types),
-                                                                   n0_values),
-                                                                   framework::dataset::make("K0", { 4, 8, 16 })),
+                                                                   n0_values_nightly),
+                                                                   k0_t_values_nightly),
                                                                    h0_values),
                                                                    i_values),
 shape_in, b_value, data_type, n0_value, k0_value, h0_value, i_value)
@@ -110,8 +125,8 @@
 DATA_TEST_CASE(Configuration1, framework::DatasetMode::ALL, combine(combine(combine(combine(combine(combine(datasets::SmallGEMMReshape2DShapes(),
                                                                    b_values),
                                                                    data_types),
-                                                                   n0_values),
-                                                                   framework::dataset::make("K0", { 1, 2, 4, 8, 16 })),
+                                                                   n0_values_nightly),
+                                                                   k0_nt_values_nightly),
                                                                    h0_values),
                                                                    i_values),
 shape_in, b_value, data_type, n0_value, k0_value, h0_value, i_value)
@@ -140,12 +155,12 @@
 
 TEST_SUITE(S32)
 // RunSmall tests only for transpose = false
-FIXTURE_DATA_TEST_CASE(RunSmall0, CLGEMMReshapeRHSMatrixFixture<int>, framework::DatasetMode::ALL,
+FIXTURE_DATA_TEST_CASE(RunSmall0, CLGEMMReshapeRHSMatrixFixture<int>, framework::DatasetMode::PRECOMMIT,
                 combine(combine(combine(combine(combine(combine(combine(datasets::SmallGEMMReshape2DShapes(),
                                                                    b_values),
                                                                    framework::dataset::make("DataType", DataType::S32)),
-                                                                   n0_values),
-                                                                   framework::dataset::make("K0", { 1, 2, 4, 8, 16 })),
+                                                                   n0_values_precommit),
+                                                                   k0_nt_values_precommit),
                                                                    h0_values),
                                                                    i_values),
                                                                    framework::dataset::make("transpose", false)))
@@ -155,12 +170,12 @@
 }
 
 // RunSmall tests only for transpose = true
-FIXTURE_DATA_TEST_CASE(RunSmall1, CLGEMMReshapeRHSMatrixFixture<int>, framework::DatasetMode::ALL,
+FIXTURE_DATA_TEST_CASE(RunSmall1, CLGEMMReshapeRHSMatrixFixture<int>, framework::DatasetMode::PRECOMMIT,
                 combine(combine(combine(combine(combine(combine(combine(datasets::SmallGEMMReshape2DShapes(),
                                                                    b_values),
                                                                    framework::dataset::make("DataType", DataType::S32)),
-                                                                   n0_values),
-                                                                   framework::dataset::make("K0", { 4, 8, 16 })),
+                                                                   n0_values_precommit),
+                                                                   k0_t_values_precommit),
                                                                    h0_values),
                                                                    i_values),
                                                                    framework::dataset::make("transpose", true)))
@@ -174,8 +189,8 @@
                 combine(combine(combine(combine(combine(combine(combine(datasets::LargeGEMMReshape2DShapes(),
                                                                    b_values),
                                                                    framework::dataset::make("DataType", DataType::S32)),
-                                                                   n0_values),
-                                                                   framework::dataset::make("K0", { 1, 2, 4, 8, 16 })),
+                                                                   n0_values_nightly),
+                                                                   k0_nt_values_nightly),
                                                                    h0_values),
                                                                    i_values),
                                                                    framework::dataset::make("transpose", false)))
@@ -189,8 +204,8 @@
                 combine(combine(combine(combine(combine(combine(combine(datasets::LargeGEMMReshape2DShapes(),
                                                                    b_values),
                                                                    framework::dataset::make("DataType", DataType::S32)),
-                                                                   n0_values),
-                                                                   framework::dataset::make("K0", { 4, 8, 16 })),
+                                                                   n0_values_nightly),
+                                                                   k0_t_values_nightly),
                                                                    h0_values),
                                                                    i_values),
                                                                    framework::dataset::make("transpose", true)))
@@ -202,12 +217,12 @@
 
 TEST_SUITE(S16)
 // RunSmall tests only for transpose = false
-FIXTURE_DATA_TEST_CASE(RunSmall0, CLGEMMReshapeRHSMatrixFixture<short>, framework::DatasetMode::ALL,
+FIXTURE_DATA_TEST_CASE(RunSmall0, CLGEMMReshapeRHSMatrixFixture<short>, framework::DatasetMode::PRECOMMIT,
                 combine(combine(combine(combine(combine(combine(combine(datasets::SmallGEMMReshape2DShapes(),
                                                                    b_values),
-                                                                   framework::dataset::make("DataType", DataType::S16)),
-                                                                   n0_values),
-                                                                   framework::dataset::make("K0", { 1, 2, 4, 8, 16 })),
+                                                                   framework::dataset::make("DataType", DataType::S32)),
+                                                                   n0_values_precommit),
+                                                                   k0_nt_values_precommit),
                                                                    h0_values),
                                                                    i_values),
                                                                    framework::dataset::make("transpose", false)))
@@ -217,12 +232,12 @@
 }
 
 // RunSmall tests only for transpose = true
-FIXTURE_DATA_TEST_CASE(RunSmall1, CLGEMMReshapeRHSMatrixFixture<short>, framework::DatasetMode::ALL,
+FIXTURE_DATA_TEST_CASE(RunSmall1, CLGEMMReshapeRHSMatrixFixture<short>, framework::DatasetMode::PRECOMMIT,
                 combine(combine(combine(combine(combine(combine(combine(datasets::SmallGEMMReshape2DShapes(),
                                                                    b_values),
-                                                                   framework::dataset::make("DataType", DataType::S16)),
-                                                                   n0_values),
-                                                                   framework::dataset::make("K0", { 4, 8, 16 })),
+                                                                   framework::dataset::make("DataType", DataType::S32)),
+                                                                   n0_values_precommit),
+                                                                   k0_t_values_precommit),
                                                                    h0_values),
                                                                    i_values),
                                                                    framework::dataset::make("transpose", true)))
@@ -235,9 +250,9 @@
 FIXTURE_DATA_TEST_CASE(RunLarge0, CLGEMMReshapeRHSMatrixFixture<short>, framework::DatasetMode::NIGHTLY,
                 combine(combine(combine(combine(combine(combine(combine(datasets::LargeGEMMReshape2DShapes(),
                                                                    b_values),
-                                                                   framework::dataset::make("DataType", DataType::S16)),
-                                                                   n0_values),
-                                                                   framework::dataset::make("K0", { 1, 2, 4, 8, 16 })),
+                                                                   framework::dataset::make("DataType", DataType::S32)),
+                                                                   n0_values_nightly),
+                                                                   k0_nt_values_nightly),
                                                                    h0_values),
                                                                    i_values),
                                                                    framework::dataset::make("transpose", false)))
@@ -250,9 +265,9 @@
 FIXTURE_DATA_TEST_CASE(RunLarge1, CLGEMMReshapeRHSMatrixFixture<short>, framework::DatasetMode::NIGHTLY,
                 combine(combine(combine(combine(combine(combine(combine(datasets::LargeGEMMReshape2DShapes(),
                                                                    b_values),
-                                                                   framework::dataset::make("DataType", DataType::S16)),
-                                                                   n0_values),
-                                                                   framework::dataset::make("K0", { 4, 8, 16 })),
+                                                                   framework::dataset::make("DataType", DataType::S32)),
+                                                                   n0_values_nightly),
+                                                                   k0_t_values_nightly),
                                                                    h0_values),
                                                                    i_values),
                                                                    framework::dataset::make("transpose", true)))
@@ -264,12 +279,12 @@
 
 TEST_SUITE(S8)
 // RunSmall tests only for transpose = false
-FIXTURE_DATA_TEST_CASE(RunSmall0, CLGEMMReshapeRHSMatrixFixture<char>, framework::DatasetMode::ALL,
+FIXTURE_DATA_TEST_CASE(RunSmall0, CLGEMMReshapeRHSMatrixFixture<char>, framework::DatasetMode::PRECOMMIT,
                 combine(combine(combine(combine(combine(combine(combine(datasets::SmallGEMMReshape2DShapes(),
                                                                    b_values),
-                                                                   framework::dataset::make("DataType", DataType::S8)),
-                                                                   n0_values),
-                                                                   framework::dataset::make("K0", { 1, 2, 4, 8, 16 })),
+                                                                   framework::dataset::make("DataType", DataType::S32)),
+                                                                   n0_values_precommit),
+                                                                   k0_nt_values_precommit),
                                                                    h0_values),
                                                                    i_values),
                                                                    framework::dataset::make("transpose", false)))
@@ -279,12 +294,12 @@
 }
 
 // RunSmall tests only for transpose = true
-FIXTURE_DATA_TEST_CASE(RunSmall1, CLGEMMReshapeRHSMatrixFixture<char>, framework::DatasetMode::ALL,
+FIXTURE_DATA_TEST_CASE(RunSmall1, CLGEMMReshapeRHSMatrixFixture<char>, framework::DatasetMode::PRECOMMIT,
                 combine(combine(combine(combine(combine(combine(combine(datasets::SmallGEMMReshape2DShapes(),
                                                                    b_values),
-                                                                   framework::dataset::make("DataType", DataType::S8)),
-                                                                   n0_values),
-                                                                   framework::dataset::make("K0", { 4, 8, 16 })),
+                                                                   framework::dataset::make("DataType", DataType::S32)),
+                                                                   n0_values_precommit),
+                                                                   k0_t_values_precommit),
                                                                    h0_values),
                                                                    i_values),
                                                                    framework::dataset::make("transpose", true)))
@@ -297,9 +312,9 @@
 FIXTURE_DATA_TEST_CASE(RunLarge0, CLGEMMReshapeRHSMatrixFixture<char>, framework::DatasetMode::NIGHTLY,
                 combine(combine(combine(combine(combine(combine(combine(datasets::LargeGEMMReshape2DShapes(),
                                                                    b_values),
-                                                                   framework::dataset::make("DataType", DataType::S8)),
-                                                                   n0_values),
-                                                                   framework::dataset::make("K0", { 1, 2, 4, 8, 16 })),
+                                                                   framework::dataset::make("DataType", DataType::S32)),
+                                                                   n0_values_nightly),
+                                                                   k0_nt_values_nightly),
                                                                    h0_values),
                                                                    i_values),
                                                                    framework::dataset::make("transpose", false)))
@@ -312,9 +327,9 @@
 FIXTURE_DATA_TEST_CASE(RunLarge1, CLGEMMReshapeRHSMatrixFixture<char>, framework::DatasetMode::NIGHTLY,
                 combine(combine(combine(combine(combine(combine(combine(datasets::LargeGEMMReshape2DShapes(),
                                                                    b_values),
-                                                                   framework::dataset::make("DataType", DataType::S8)),
-                                                                   n0_values),
-                                                                   framework::dataset::make("K0", { 4, 8, 16 })),
+                                                                   framework::dataset::make("DataType", DataType::S32)),
+                                                                   n0_values_nightly),
+                                                                   k0_t_values_nightly),
                                                                    h0_values),
                                                                    i_values),
                                                                    framework::dataset::make("transpose", true)))