COMPMID-670 - Extend Sobel tests

Change-Id: Ibf15544e8624977815ee355071a038c07e1f01c2
Reviewed-on: http://mpd-gerrit.cambridge.arm.com/94874
Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
diff --git a/tests/validation/CL/Sobel.cpp b/tests/validation/CL/Sobel.cpp
index cde93e7..16f411d 100644
--- a/tests/validation/CL/Sobel.cpp
+++ b/tests/validation/CL/Sobel.cpp
@@ -100,8 +100,50 @@
     validate(dst_y.info()->padding(), dst_padding);
 }
 
-FIXTURE_DATA_TEST_CASE(RunSmall, CLSobel3x3Fixture, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
-                                                                                               Format::U8)))
+TEST_SUITE(X)
+FIXTURE_DATA_TEST_CASE(RunSmall, CLSobel3x3Fixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
+                                                                                                       Format::U8)),
+                                                                                               framework::dataset::make("GradientDimension", GradientDimension::GRAD_X)))
+{
+    // Validate output
+    ValidRegion valid_region_x = shape_to_valid_region(_reference.first.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(1));
+    validate(CLAccessor(_target.first), _reference.first, valid_region_x);
+}
+
+FIXTURE_DATA_TEST_CASE(RunLarge, CLSobel3x3Fixture, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::Large2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
+                                                                                                     Format::U8)),
+                                                                                             framework::dataset::make("GradientDimension", GradientDimension::GRAD_X)))
+{
+    // Validate output
+    ValidRegion valid_region_x = shape_to_valid_region(_reference.first.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(1));
+    validate(CLAccessor(_target.first), _reference.first, valid_region_x);
+}
+TEST_SUITE_END()
+
+TEST_SUITE(Y)
+FIXTURE_DATA_TEST_CASE(RunSmall, CLSobel3x3Fixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
+                                                                                                       Format::U8)),
+                                                                                               framework::dataset::make("GradientDimension", GradientDimension::GRAD_Y)))
+{
+    // Validate output
+    ValidRegion valid_region_y = shape_to_valid_region(_reference.second.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(1));
+    validate(CLAccessor(_target.second), _reference.second, valid_region_y);
+}
+
+FIXTURE_DATA_TEST_CASE(RunLarge, CLSobel3x3Fixture, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::Large2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
+                                                                                                     Format::U8)),
+                                                                                             framework::dataset::make("GradientDimension", GradientDimension::GRAD_Y)))
+{
+    // Validate output
+    ValidRegion valid_region_y = shape_to_valid_region(_reference.second.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(1));
+    validate(CLAccessor(_target.second), _reference.second, valid_region_y);
+}
+TEST_SUITE_END()
+
+TEST_SUITE(XY)
+FIXTURE_DATA_TEST_CASE(RunSmall, CLSobel3x3Fixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
+                                                                                                       Format::U8)),
+                                                                                               framework::dataset::make("GradientDimension", GradientDimension::GRAD_XY)))
 {
     // Validate output
     ValidRegion valid_region_x = shape_to_valid_region(_reference.first.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(1));
@@ -111,8 +153,9 @@
     validate(CLAccessor(_target.second), _reference.second, valid_region_y);
 }
 
-FIXTURE_DATA_TEST_CASE(RunLarge, CLSobel3x3Fixture, framework::DatasetMode::NIGHTLY, combine(combine(datasets::Large2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
-                                                                                             Format::U8)))
+FIXTURE_DATA_TEST_CASE(RunLarge, CLSobel3x3Fixture, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::Large2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
+                                                                                                     Format::U8)),
+                                                                                             framework::dataset::make("GradientDimension", GradientDimension::GRAD_XY)))
 {
     // Validate output
     ValidRegion valid_region_x = shape_to_valid_region(_reference.first.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(1));
@@ -122,6 +165,7 @@
     validate(CLAccessor(_target.second), _reference.second, valid_region_y);
 }
 TEST_SUITE_END()
+TEST_SUITE_END()
 
 TEST_SUITE(W5x5)
 using CLSobel5x5Fixture = SobelValidationFixture<CLTensor, CLAccessor, CLSobel5x5, uint8_t, int16_t>;
@@ -176,8 +220,48 @@
     validate(dst_y.info()->padding(), dst_padding);
 }
 
-FIXTURE_DATA_TEST_CASE(RunSmall, CLSobel5x5Fixture, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
-                                                                                               Format::U8)))
+TEST_SUITE(X)
+FIXTURE_DATA_TEST_CASE(RunSmall, CLSobel5x5Fixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
+                                                                                                       Format::U8)),
+                                                                                               framework::dataset::make("GradientDimension", GradientDimension::GRAD_X)))
+{
+    // Validate output
+    ValidRegion valid_region_x = shape_to_valid_region(_reference.first.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(2));
+    validate(CLAccessor(_target.first), _reference.first, valid_region_x);
+}
+
+FIXTURE_DATA_TEST_CASE(RunLarge, CLSobel5x5Fixture, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::Large2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
+                                                                                                     Format::U8)),
+                                                                                             framework::dataset::make("GradientDimension", GradientDimension::GRAD_X)))
+{
+    // Validate output
+    ValidRegion valid_region_x = shape_to_valid_region(_reference.first.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(2));
+    validate(CLAccessor(_target.first), _reference.first, valid_region_x);
+}
+TEST_SUITE_END()
+TEST_SUITE(Y)
+FIXTURE_DATA_TEST_CASE(RunSmall, CLSobel5x5Fixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
+                                                                                                       Format::U8)),
+                                                                                               framework::dataset::make("GradientDimension", GradientDimension::GRAD_Y)))
+{
+    // Validate output
+    ValidRegion valid_region_y = shape_to_valid_region(_reference.second.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(2));
+    validate(CLAccessor(_target.second), _reference.second, valid_region_y);
+}
+
+FIXTURE_DATA_TEST_CASE(RunLarge, CLSobel5x5Fixture, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::Large2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
+                                                                                                     Format::U8)),
+                                                                                             framework::dataset::make("GradientDimension", GradientDimension::GRAD_Y)))
+{
+    // Validate output
+    ValidRegion valid_region_y = shape_to_valid_region(_reference.second.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(2));
+    validate(CLAccessor(_target.second), _reference.second, valid_region_y);
+}
+TEST_SUITE_END()
+TEST_SUITE(XY)
+FIXTURE_DATA_TEST_CASE(RunSmall, CLSobel5x5Fixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
+                                                                                                       Format::U8)),
+                                                                                               framework::dataset::make("GradientDimension", GradientDimension::GRAD_XY)))
 {
     // Validate output
     ValidRegion valid_region_x = shape_to_valid_region(_reference.first.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(2));
@@ -187,8 +271,9 @@
     validate(CLAccessor(_target.second), _reference.second, valid_region_y);
 }
 
-FIXTURE_DATA_TEST_CASE(RunLarge, CLSobel5x5Fixture, framework::DatasetMode::NIGHTLY, combine(combine(datasets::Large2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
-                                                                                             Format::U8)))
+FIXTURE_DATA_TEST_CASE(RunLarge, CLSobel5x5Fixture, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::Large2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
+                                                                                                     Format::U8)),
+                                                                                             framework::dataset::make("GradientDimension", GradientDimension::GRAD_XY)))
 {
     // Validate output
     ValidRegion valid_region_x = shape_to_valid_region(_reference.first.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(2));
@@ -198,6 +283,7 @@
     validate(CLAccessor(_target.second), _reference.second, valid_region_y);
 }
 TEST_SUITE_END()
+TEST_SUITE_END()
 
 TEST_SUITE(W7x7)
 using CLSobel7x7Fixture = SobelValidationFixture<CLTensor, CLAccessor, CLSobel7x7, uint8_t, int32_t>;
@@ -252,9 +338,48 @@
     validate(dst_x.info()->padding(), dst_padding);
     validate(dst_y.info()->padding(), dst_padding);
 }
+TEST_SUITE(X)
+FIXTURE_DATA_TEST_CASE(RunSmall, CLSobel7x7Fixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
+                                                                                                       Format::U8)),
+                                                                                               framework::dataset::make("GradientDimension", GradientDimension::GRAD_X)))
+{
+    // Validate output
+    ValidRegion valid_region_x = shape_to_valid_region(_reference.first.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(3));
+    validate(CLAccessor(_target.first), _reference.first, valid_region_x);
+}
 
-FIXTURE_DATA_TEST_CASE(RunSmall, CLSobel7x7Fixture, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
-                                                                                               Format::U8)))
+FIXTURE_DATA_TEST_CASE(RunLarge, CLSobel7x7Fixture, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::Large2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
+                                                                                                     Format::U8)),
+                                                                                             framework::dataset::make("GradientDimension", GradientDimension::GRAD_X)))
+{
+    // Validate output
+    ValidRegion valid_region_x = shape_to_valid_region(_reference.first.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(3));
+    validate(CLAccessor(_target.first), _reference.first, valid_region_x);
+}
+TEST_SUITE_END()
+TEST_SUITE(Y)
+FIXTURE_DATA_TEST_CASE(RunSmall, CLSobel7x7Fixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
+                                                                                                       Format::U8)),
+                                                                                               framework::dataset::make("GradientDimension", GradientDimension::GRAD_Y)))
+{
+    // Validate output
+    ValidRegion valid_region_y = shape_to_valid_region(_reference.second.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(3));
+    validate(CLAccessor(_target.second), _reference.second, valid_region_y);
+}
+
+FIXTURE_DATA_TEST_CASE(RunLarge, CLSobel7x7Fixture, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::Large2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
+                                                                                                     Format::U8)),
+                                                                                             framework::dataset::make("GradientDimension", GradientDimension::GRAD_Y)))
+{
+    // Validate output
+    ValidRegion valid_region_y = shape_to_valid_region(_reference.second.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(3));
+    validate(CLAccessor(_target.second), _reference.second, valid_region_y);
+}
+TEST_SUITE_END()
+TEST_SUITE(XY)
+FIXTURE_DATA_TEST_CASE(RunSmall, CLSobel7x7Fixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
+                                                                                                       Format::U8)),
+                                                                                               framework::dataset::make("GradientDimension", GradientDimension::GRAD_XY)))
 {
     // Validate output
     ValidRegion valid_region_x = shape_to_valid_region(_reference.first.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(3));
@@ -264,8 +389,9 @@
     validate(CLAccessor(_target.second), _reference.second, valid_region_y);
 }
 
-FIXTURE_DATA_TEST_CASE(RunLarge, CLSobel7x7Fixture, framework::DatasetMode::NIGHTLY, combine(combine(datasets::Large2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
-                                                                                             Format::U8)))
+FIXTURE_DATA_TEST_CASE(RunLarge, CLSobel7x7Fixture, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::Large2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
+                                                                                                     Format::U8)),
+                                                                                             framework::dataset::make("GradientDimension", GradientDimension::GRAD_XY)))
 {
     // Validate output
     ValidRegion valid_region_x = shape_to_valid_region(_reference.first.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(3));
@@ -275,6 +401,7 @@
     validate(CLAccessor(_target.second), _reference.second, valid_region_y);
 }
 TEST_SUITE_END()
+TEST_SUITE_END()
 
 TEST_SUITE_END()
 TEST_SUITE_END()
diff --git a/tests/validation/CPP/HarrisCornerDetector.cpp b/tests/validation/CPP/HarrisCornerDetector.cpp
index 3babfee..6cfcd8e 100644
--- a/tests/validation/CPP/HarrisCornerDetector.cpp
+++ b/tests/validation/CPP/HarrisCornerDetector.cpp
@@ -45,7 +45,7 @@
     SimpleTensor<T> grad_y;
     float           norm_factor = 0.f;
 
-    std::tie(grad_x, grad_y) = sobel<T>(src, gradient_size, border_mode, constant_border_value);
+    std::tie(grad_x, grad_y) = sobel<T>(src, gradient_size, border_mode, constant_border_value, GradientDimension::GRAD_XY);
 
     switch(gradient_size)
     {
diff --git a/tests/validation/CPP/Sobel.cpp b/tests/validation/CPP/Sobel.cpp
index 314fbd4..ff0e11d 100644
--- a/tests/validation/CPP/Sobel.cpp
+++ b/tests/validation/CPP/Sobel.cpp
@@ -103,7 +103,7 @@
 } // namespace
 
 template <typename T, typename U>
-std::pair<SimpleTensor<T>, SimpleTensor<T>> sobel(const SimpleTensor<U> &src, int filter_size, BorderMode border_mode, uint8_t constant_border_value)
+std::pair<SimpleTensor<T>, SimpleTensor<T>> sobel(const SimpleTensor<U> &src, int filter_size, BorderMode border_mode, uint8_t constant_border_value, GradientDimension gradient_dimension)
 {
     SimpleTensor<T> dst_x(src.shape(), data_type<T>::value, src.num_channels());
     SimpleTensor<T> dst_y(src.shape(), data_type<T>::value, src.num_channels());
@@ -118,18 +118,34 @@
         {
             continue;
         }
-
-        apply_2d_spatial_filter(coord, src, dst_x, TensorShape{ static_cast<unsigned int>(filter_size), static_cast<unsigned int>(filter_size) }, masks.at(filter_size).first, 1.f, border_mode,
-                                constant_border_value);
-        apply_2d_spatial_filter(coord, src, dst_y, TensorShape{ static_cast<unsigned int>(filter_size), static_cast<unsigned int>(filter_size) }, masks.at(filter_size).second, 1.f, border_mode,
-                                constant_border_value);
+        switch(gradient_dimension)
+        {
+            case GradientDimension::GRAD_X:
+                apply_2d_spatial_filter(coord, src, dst_x, TensorShape{ static_cast<unsigned int>(filter_size), static_cast<unsigned int>(filter_size) }, masks.at(filter_size).first, 1.f, border_mode,
+                                        constant_border_value);
+                break;
+            case GradientDimension::GRAD_Y:
+                apply_2d_spatial_filter(coord, src, dst_y, TensorShape{ static_cast<unsigned int>(filter_size), static_cast<unsigned int>(filter_size) }, masks.at(filter_size).second, 1.f, border_mode,
+                                        constant_border_value);
+                break;
+            case GradientDimension::GRAD_XY:
+                apply_2d_spatial_filter(coord, src, dst_x, TensorShape{ static_cast<unsigned int>(filter_size), static_cast<unsigned int>(filter_size) }, masks.at(filter_size).first, 1.f, border_mode,
+                                        constant_border_value);
+                apply_2d_spatial_filter(coord, src, dst_y, TensorShape{ static_cast<unsigned int>(filter_size), static_cast<unsigned int>(filter_size) }, masks.at(filter_size).second, 1.f, border_mode,
+                                        constant_border_value);
+                break;
+            default:
+                ARM_COMPUTE_ERROR("Gradient dimension not supported");
+        }
     }
 
     return std::make_pair(dst_x, dst_y);
 }
 
-template std::pair<SimpleTensor<int16_t>, SimpleTensor<int16_t>> sobel(const SimpleTensor<uint8_t> &src, int filter_size, BorderMode border_mode, uint8_t constant_border_value);
-template std::pair<SimpleTensor<int>, SimpleTensor<int>> sobel(const SimpleTensor<uint8_t> &src, int filter_size, BorderMode border_mode, uint8_t constant_border_value);
+template std::pair<SimpleTensor<int16_t>, SimpleTensor<int16_t>> sobel(const SimpleTensor<uint8_t> &src, int filter_size, BorderMode border_mode, uint8_t constant_border_value,
+                                                                       GradientDimension gradient_dimension);
+template std::pair<SimpleTensor<int>, SimpleTensor<int>> sobel(const SimpleTensor<uint8_t> &src, int filter_size, BorderMode border_mode, uint8_t constant_border_value,
+                                                               GradientDimension gradient_dimension);
 } // namespace reference
 } // namespace validation
 } // namespace test
diff --git a/tests/validation/CPP/Sobel.h b/tests/validation/CPP/Sobel.h
index ab04663..9099f1a 100644
--- a/tests/validation/CPP/Sobel.h
+++ b/tests/validation/CPP/Sobel.h
@@ -26,6 +26,7 @@
 
 #include "arm_compute/core/Types.h"
 #include "tests/SimpleTensor.h"
+#include "tests/Types.h"
 
 namespace arm_compute
 {
@@ -36,7 +37,7 @@
 namespace reference
 {
 template <typename T, typename U>
-std::pair<SimpleTensor<T>, SimpleTensor<T>> sobel(const SimpleTensor<U> &src, int filter_size, BorderMode border_mode, uint8_t constant_border_value = 0);
+std::pair<SimpleTensor<T>, SimpleTensor<T>> sobel(const SimpleTensor<U> &src, int filter_size, BorderMode border_mode, uint8_t constant_border_value, GradientDimension gradient_dimension);
 } // namespace reference
 } // namespace validation
 } // namespace test
diff --git a/tests/validation/NEON/Sobel.cpp b/tests/validation/NEON/Sobel.cpp
index 99f9e1f..e757d1d 100644
--- a/tests/validation/NEON/Sobel.cpp
+++ b/tests/validation/NEON/Sobel.cpp
@@ -100,8 +100,48 @@
     validate(dst_y.info()->padding(), dst_padding);
 }
 
-FIXTURE_DATA_TEST_CASE(RunSmall, NESobel3x3Fixture, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
-                                                                                               Format::U8)))
+TEST_SUITE(X)
+FIXTURE_DATA_TEST_CASE(RunSmall, NESobel3x3Fixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
+                                                                                                       Format::U8)),
+                                                                                               framework::dataset::make("GradientDimension", GradientDimension::GRAD_X)))
+{
+    // Validate output
+    ValidRegion valid_region_x = shape_to_valid_region(_reference.first.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(1));
+    validate(Accessor(_target.first), _reference.first, valid_region_x);
+}
+
+FIXTURE_DATA_TEST_CASE(RunLarge, NESobel3x3Fixture, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::Large2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
+                                                                                                     Format::U8)),
+                                                                                             framework::dataset::make("GradientDimension", GradientDimension::GRAD_X)))
+{
+    // Validate output
+    ValidRegion valid_region_x = shape_to_valid_region(_reference.first.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(1));
+    validate(Accessor(_target.first), _reference.first, valid_region_x);
+}
+TEST_SUITE_END()
+TEST_SUITE(Y)
+FIXTURE_DATA_TEST_CASE(RunSmall, NESobel3x3Fixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
+                                                                                                       Format::U8)),
+                                                                                               framework::dataset::make("GradientDimension", GradientDimension::GRAD_Y)))
+{
+    // Validate output
+    ValidRegion valid_region_y = shape_to_valid_region(_reference.second.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(1));
+    validate(Accessor(_target.second), _reference.second, valid_region_y);
+}
+
+FIXTURE_DATA_TEST_CASE(RunLarge, NESobel3x3Fixture, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::Large2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
+                                                                                                     Format::U8)),
+                                                                                             framework::dataset::make("GradientDimension", GradientDimension::GRAD_Y)))
+{
+    // Validate output
+    ValidRegion valid_region_y = shape_to_valid_region(_reference.second.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(1));
+    validate(Accessor(_target.second), _reference.second, valid_region_y);
+}
+TEST_SUITE_END()
+TEST_SUITE(XY)
+FIXTURE_DATA_TEST_CASE(RunSmall, NESobel3x3Fixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
+                                                                                                       Format::U8)),
+                                                                                               framework::dataset::make("GradientDimension", GradientDimension::GRAD_XY)))
 {
     // Validate output
     ValidRegion valid_region_x = shape_to_valid_region(_reference.first.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(1));
@@ -111,8 +151,9 @@
     validate(Accessor(_target.second), _reference.second, valid_region_y);
 }
 
-FIXTURE_DATA_TEST_CASE(RunLarge, NESobel3x3Fixture, framework::DatasetMode::NIGHTLY, combine(combine(datasets::Large2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
-                                                                                             Format::U8)))
+FIXTURE_DATA_TEST_CASE(RunLarge, NESobel3x3Fixture, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::Large2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
+                                                                                                     Format::U8)),
+                                                                                             framework::dataset::make("GradientDimension", GradientDimension::GRAD_XY)))
 {
     // Validate output
     ValidRegion valid_region_x = shape_to_valid_region(_reference.first.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(1));
@@ -122,6 +163,7 @@
     validate(Accessor(_target.second), _reference.second, valid_region_y);
 }
 TEST_SUITE_END()
+TEST_SUITE_END()
 
 TEST_SUITE(W5x5)
 using NESobel5x5Fixture = SobelValidationFixture<Tensor, Accessor, NESobel5x5, uint8_t, int16_t>;
@@ -176,9 +218,48 @@
     validate(dst_x.info()->padding(), dst_padding);
     validate(dst_y.info()->padding(), dst_padding);
 }
+TEST_SUITE(X)
+FIXTURE_DATA_TEST_CASE(RunSmall, NESobel5x5Fixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
+                                                                                                       Format::U8)),
+                                                                                               framework::dataset::make("GradientDimension", GradientDimension::GRAD_X)))
+{
+    // Validate output
+    ValidRegion valid_region_x = shape_to_valid_region(_reference.first.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(2));
+    validate(Accessor(_target.first), _reference.first, valid_region_x);
+}
 
-FIXTURE_DATA_TEST_CASE(RunSmall, NESobel5x5Fixture, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
-                                                                                               Format::U8)))
+FIXTURE_DATA_TEST_CASE(RunLarge, NESobel5x5Fixture, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::Large2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
+                                                                                                     Format::U8)),
+                                                                                             framework::dataset::make("GradientDimension", GradientDimension::GRAD_X)))
+{
+    // Validate output
+    ValidRegion valid_region_x = shape_to_valid_region(_reference.first.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(2));
+    validate(Accessor(_target.first), _reference.first, valid_region_x);
+}
+TEST_SUITE_END()
+TEST_SUITE(Y)
+FIXTURE_DATA_TEST_CASE(RunSmall, NESobel5x5Fixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
+                                                                                                       Format::U8)),
+                                                                                               framework::dataset::make("GradientDimension", GradientDimension::GRAD_Y)))
+{
+    // Validate output
+    ValidRegion valid_region_y = shape_to_valid_region(_reference.second.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(2));
+    validate(Accessor(_target.second), _reference.second, valid_region_y);
+}
+
+FIXTURE_DATA_TEST_CASE(RunLarge, NESobel5x5Fixture, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::Large2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
+                                                                                                     Format::U8)),
+                                                                                             framework::dataset::make("GradientDimension", GradientDimension::GRAD_Y)))
+{
+    // Validate output
+    ValidRegion valid_region_y = shape_to_valid_region(_reference.second.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(2));
+    validate(Accessor(_target.second), _reference.second, valid_region_y);
+}
+TEST_SUITE_END()
+TEST_SUITE(XY)
+FIXTURE_DATA_TEST_CASE(RunSmall, NESobel5x5Fixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
+                                                                                                       Format::U8)),
+                                                                                               framework::dataset::make("GradientDimension", GradientDimension::GRAD_XY)))
 {
     // Validate output
     ValidRegion valid_region_x = shape_to_valid_region(_reference.first.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(2));
@@ -188,8 +269,9 @@
     validate(Accessor(_target.second), _reference.second, valid_region_y);
 }
 
-FIXTURE_DATA_TEST_CASE(RunLarge, NESobel5x5Fixture, framework::DatasetMode::NIGHTLY, combine(combine(datasets::Large2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
-                                                                                             Format::U8)))
+FIXTURE_DATA_TEST_CASE(RunLarge, NESobel5x5Fixture, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::Large2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
+                                                                                                     Format::U8)),
+                                                                                             framework::dataset::make("GradientDimension", GradientDimension::GRAD_XY)))
 {
     // Validate output
     ValidRegion valid_region_x = shape_to_valid_region(_reference.first.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(2));
@@ -199,6 +281,7 @@
     validate(Accessor(_target.second), _reference.second, valid_region_y);
 }
 TEST_SUITE_END()
+TEST_SUITE_END()
 
 TEST_SUITE(W7x7)
 using NESobel7x7Fixture = SobelValidationFixture<Tensor, Accessor, NESobel7x7, uint8_t, int32_t>;
@@ -253,9 +336,48 @@
     validate(dst_x.info()->padding(), dst_padding);
     validate(dst_y.info()->padding(), dst_padding);
 }
+TEST_SUITE(X)
+FIXTURE_DATA_TEST_CASE(RunSmall, NESobel7x7Fixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
+                                                                                                       Format::U8)),
+                                                                                               framework::dataset::make("GradientDimension", GradientDimension::GRAD_X)))
+{
+    // Validate output
+    ValidRegion valid_region_x = shape_to_valid_region(_reference.first.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(3));
+    validate(Accessor(_target.first), _reference.first, valid_region_x);
+}
 
-FIXTURE_DATA_TEST_CASE(RunSmall, NESobel7x7Fixture, framework::DatasetMode::PRECOMMIT, combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
-                                                                                               Format::U8)))
+FIXTURE_DATA_TEST_CASE(RunLarge, NESobel7x7Fixture, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::Large2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
+                                                                                                     Format::U8)),
+                                                                                             framework::dataset::make("GradientDimension", GradientDimension::GRAD_X)))
+{
+    // Validate output
+    ValidRegion valid_region_x = shape_to_valid_region(_reference.first.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(3));
+    validate(Accessor(_target.first), _reference.first, valid_region_x);
+}
+TEST_SUITE_END()
+TEST_SUITE(Y)
+FIXTURE_DATA_TEST_CASE(RunSmall, NESobel7x7Fixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
+                                                                                                       Format::U8)),
+                                                                                               framework::dataset::make("GradientDimension", GradientDimension::GRAD_Y)))
+{
+    // Validate output
+    ValidRegion valid_region_y = shape_to_valid_region(_reference.second.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(3));
+    validate(Accessor(_target.second), _reference.second, valid_region_y);
+}
+
+FIXTURE_DATA_TEST_CASE(RunLarge, NESobel7x7Fixture, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::Large2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
+                                                                                                     Format::U8)),
+                                                                                             framework::dataset::make("GradientDimension", GradientDimension::GRAD_Y)))
+{
+    // Validate output
+    ValidRegion valid_region_y = shape_to_valid_region(_reference.second.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(3));
+    validate(Accessor(_target.second), _reference.second, valid_region_y);
+}
+TEST_SUITE_END()
+TEST_SUITE(XY)
+FIXTURE_DATA_TEST_CASE(RunSmall, NESobel7x7Fixture, framework::DatasetMode::PRECOMMIT, combine(combine(combine(datasets::Small2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
+                                                                                                       Format::U8)),
+                                                                                               framework::dataset::make("GradientDimension", GradientDimension::GRAD_XY)))
 {
     // Validate output
     ValidRegion valid_region_x = shape_to_valid_region(_reference.first.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(3));
@@ -265,8 +387,9 @@
     validate(Accessor(_target.second), _reference.second, valid_region_y);
 }
 
-FIXTURE_DATA_TEST_CASE(RunLarge, NESobel7x7Fixture, framework::DatasetMode::NIGHTLY, combine(combine(datasets::Large2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
-                                                                                             Format::U8)))
+FIXTURE_DATA_TEST_CASE(RunLarge, NESobel7x7Fixture, framework::DatasetMode::NIGHTLY, combine(combine(combine(datasets::Large2DShapes(), datasets::BorderModes()), framework::dataset::make("Format",
+                                                                                                     Format::U8)),
+                                                                                             framework::dataset::make("GradientDimension", GradientDimension::GRAD_XY)))
 {
     // Validate output
     ValidRegion valid_region_x = shape_to_valid_region(_reference.first.shape(), (_border_mode == BorderMode::UNDEFINED), BorderSize(3));
@@ -276,6 +399,7 @@
     validate(Accessor(_target.second), _reference.second, valid_region_y);
 }
 TEST_SUITE_END()
+TEST_SUITE_END()
 
 TEST_SUITE_END()
 TEST_SUITE_END()
diff --git a/tests/validation/fixtures/SobelFixture.h b/tests/validation/fixtures/SobelFixture.h
index 2a592b8..f8041b9 100644
--- a/tests/validation/fixtures/SobelFixture.h
+++ b/tests/validation/fixtures/SobelFixture.h
@@ -102,7 +102,7 @@
 {
 public:
     template <typename...>
-    void setup(TensorShape shape, BorderMode border_mode, Format format)
+    void setup(TensorShape shape, BorderMode border_mode, Format format, GradientDimension gradient_dimension)
     {
         // Generate a random constant value
         std::mt19937                           gen(library->seed());
@@ -110,8 +110,8 @@
         const uint8_t                          constant_border_value = int_dist(gen);
 
         _border_mode = border_mode;
-        _target      = compute_target(shape, border_mode, format, constant_border_value);
-        _reference   = compute_reference(shape, info<FunctionType>::filter_size, border_mode, format, constant_border_value);
+        _target      = compute_target(shape, border_mode, format, constant_border_value, gradient_dimension);
+        _reference   = compute_reference(shape, info<FunctionType>::filter_size, border_mode, format, constant_border_value, gradient_dimension);
     }
 
 protected:
@@ -121,7 +121,7 @@
         library->fill_tensor_uniform(tensor, 0);
     }
 
-    std::pair<TensorType, TensorType> compute_target(const TensorShape &shape, BorderMode border_mode, Format format, uint8_t constant_border_value)
+    std::pair<TensorType, TensorType> compute_target(const TensorShape &shape, BorderMode border_mode, Format format, uint8_t constant_border_value, GradientDimension gradient_dimension)
     {
         // Create tensors
         TensorType src   = create_tensor<TensorType>(shape, data_type_from_format(format));
@@ -133,7 +133,21 @@
         dst_y.info()->set_format(info<FunctionType>::dst_format);
 
         FunctionType sobel;
-        sobel.configure(&src, &dst_x, &dst_y, border_mode, constant_border_value);
+
+        switch(gradient_dimension)
+        {
+            case GradientDimension::GRAD_X:
+                sobel.configure(&src, &dst_x, nullptr, border_mode, constant_border_value);
+                break;
+            case GradientDimension::GRAD_Y:
+                sobel.configure(&src, nullptr, &dst_y, border_mode, constant_border_value);
+                break;
+            case GradientDimension::GRAD_XY:
+                sobel.configure(&src, &dst_x, &dst_y, border_mode, constant_border_value);
+                break;
+            default:
+                ARM_COMPUTE_ERROR("Gradient dimension not supported");
+        }
 
         ARM_COMPUTE_EXPECT(src.info()->is_resizable(), framework::LogLevel::ERRORS);
         ARM_COMPUTE_EXPECT(dst_x.info()->is_resizable(), framework::LogLevel::ERRORS);
@@ -157,7 +171,8 @@
         return std::make_pair(std::move(dst_x), std::move(dst_y));
     }
 
-    std::pair<SimpleTensor<U>, SimpleTensor<U>> compute_reference(const TensorShape &shape, int filter_size, BorderMode border_mode, Format format, uint8_t constant_border_value)
+    std::pair<SimpleTensor<U>, SimpleTensor<U>> compute_reference(const TensorShape &shape, int filter_size, BorderMode border_mode, Format format, uint8_t constant_border_value,
+                                                                  GradientDimension gradient_dimension)
     {
         // Create reference
         SimpleTensor<T> src{ shape, format };
@@ -165,7 +180,7 @@
         // Fill reference
         fill(src);
 
-        return reference::sobel<U>(src, filter_size, border_mode, constant_border_value);
+        return reference::sobel<U>(src, filter_size, border_mode, constant_border_value, gradient_dimension);
     }
 
     BorderMode _border_mode{ BorderMode::UNDEFINED };