aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGian Marco Iodice <gianmarco.iodice@arm.com>2017-06-30 12:21:00 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-09-17 14:15:39 +0100
commitbdb6b0bb156588dc39fd5084d4c91d05b5148610 (patch)
treebb3c3645dd9abbf20462dace7828bb7ec459dc4d /tests
parentac69aa137e360340fe9f148f019d93af6c3d8336 (diff)
downloadComputeLibrary-bdb6b0bb156588dc39fd5084d4c91d05b5148610.tar.gz
COMPMID-433 - Port NEGEMM to support 16 bit fixed point
Change-Id: I82de74d7027bbc8a00a4d6671e968785280d5f6c Reviewed-on: http://mpd-gerrit.cambridge.arm.com/79498 Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com> Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com> Reviewed-by: Moritz Pflanzer <moritz.pflanzer@arm.com> Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/TensorLibrary.h1
-rw-r--r--tests/TypePrinter.h3
-rw-r--r--tests/validation/NEON/GEMM.cpp12
3 files changed, 10 insertions, 6 deletions
diff --git a/tests/TensorLibrary.h b/tests/TensorLibrary.h
index 6c079b6872..5b2c5b6fd5 100644
--- a/tests/TensorLibrary.h
+++ b/tests/TensorLibrary.h
@@ -469,6 +469,7 @@ void TensorLibrary::fill_tensor_uniform(T &&tensor, std::random_device::result_t
break;
}
case DataType::S16:
+ case DataType::QS16:
{
std::uniform_int_distribution<int16_t> distribution_s16(std::numeric_limits<int16_t>::lowest(), std::numeric_limits<int16_t>::max());
fill(tensor, distribution_s16, seed_offset);
diff --git a/tests/TypePrinter.h b/tests/TypePrinter.h
index 4fb3b64d42..ff9863e1fb 100644
--- a/tests/TypePrinter.h
+++ b/tests/TypePrinter.h
@@ -311,6 +311,9 @@ inline ::std::ostream &operator<<(::std::ostream &os, const DataType &data_type)
case DataType::S16:
os << "S16";
break;
+ case DataType::QS16:
+ os << "QS16";
+ break;
case DataType::U32:
os << "U32";
break;
diff --git a/tests/validation/NEON/GEMM.cpp b/tests/validation/NEON/GEMM.cpp
index 4174de0cc8..0b608902a3 100644
--- a/tests/validation/NEON/GEMM.cpp
+++ b/tests/validation/NEON/GEMM.cpp
@@ -50,7 +50,7 @@ using namespace arm_compute::test::validation;
namespace
{
const float tolerance_f32 = 1e-03f; /**< Tolerance value for comparing reference's output against implementation's output for DataType::F32 */
-const float tolerance_qs8 = 1.0f; /**< Tolerance value for comparing reference's output against implementation's output for DataType::QS8 */
+const float tolerance_q = 1.0f; /**< Tolerance value for comparing reference's output against implementation's output for fixed point data types */
Tensor compute_gemm(const TensorShape &src_shape1, const TensorShape &src_shape2, const TensorShape &src_shape3,
const TensorShape &out_shape, float alpha, float beta, DataType dt, int fixed_point_position = 0)
@@ -104,7 +104,7 @@ BOOST_AUTO_TEST_SUITE(GEMM)
BOOST_TEST_DECORATOR(*boost::unit_test::label("precommit") * boost::unit_test::label("nightly"))
BOOST_DATA_TEST_CASE(Configuration,
- SmallGEMMDataset() * boost::unit_test::data::make({ DataType::F32, DataType::QS8 }),
+ SmallGEMMDataset() * boost::unit_test::data::make({ DataType::F32, DataType::QS8, DataType::QS16 }),
gemm_set, dt)
{
// Set fixed point position data type allowed
@@ -187,7 +187,7 @@ BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_SUITE(Quantized)
BOOST_TEST_DECORATOR(*boost::unit_test::label("precommit"))
-BOOST_DATA_TEST_CASE(SmallGEMM, SmallGEMMDataset() * boost::unit_test::data::make(DataType::QS8) * boost::unit_test::data::xrange(1, 7),
+BOOST_DATA_TEST_CASE(SmallGEMM, SmallGEMMDataset() * boost::unit_test::data::make({ DataType::QS8, DataType::QS16 }) * boost::unit_test::data::xrange(1, 7),
gemm_set, dt, fixed_point_position)
{
// Compute reference
@@ -197,11 +197,11 @@ BOOST_DATA_TEST_CASE(SmallGEMM, SmallGEMMDataset() * boost::unit_test::data::mak
Tensor dst = compute_gemm(gemm_set.shape_a, gemm_set.shape_b, gemm_set.shape_c, gemm_set.shape_d, gemm_set.alpha, gemm_set.beta, dt, fixed_point_position);
// Validate output
- validate(NEAccessor(dst), ref_dst, tolerance_qs8);
+ validate(NEAccessor(dst), ref_dst, tolerance_q);
}
BOOST_TEST_DECORATOR(*boost::unit_test::label("nightly"))
-BOOST_DATA_TEST_CASE(LargeGEMM, LargeGEMMDataset() * boost::unit_test::data::make(DataType::QS8) * boost::unit_test::data::xrange(1, 7),
+BOOST_DATA_TEST_CASE(LargeGEMM, LargeGEMMDataset() * boost::unit_test::data::make({ DataType::QS8, DataType::QS16 }) * boost::unit_test::data::xrange(1, 7),
gemm_set, dt, fixed_point_position)
{
// Compute reference
@@ -211,7 +211,7 @@ BOOST_DATA_TEST_CASE(LargeGEMM, LargeGEMMDataset() * boost::unit_test::data::mak
Tensor dst = compute_gemm(gemm_set.shape_a, gemm_set.shape_b, gemm_set.shape_c, gemm_set.shape_d, gemm_set.alpha, gemm_set.beta, dt, fixed_point_position);
// Validate output
- validate(NEAccessor(dst), ref_dst, tolerance_qs8);
+ validate(NEAccessor(dst), ref_dst, tolerance_q);
}
BOOST_AUTO_TEST_SUITE_END()