From c3bf6efb48a4540c8addcc02813c9381e4fceb1f Mon Sep 17 00:00:00 2001 From: Narumol Prangnawarat Date: Fri, 28 Feb 2020 12:45:21 +0000 Subject: IVGCVSW-4508 Add BFloat16 data type Signed-off-by: Narumol Prangnawarat Change-Id: Ie2fcf06d0bae9e2ef958e60ab9e8b121fdc7b590 --- src/armnn/test/UtilsTests.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/armnn/test') diff --git a/src/armnn/test/UtilsTests.cpp b/src/armnn/test/UtilsTests.cpp index 4c371d6ed9..faf4480029 100644 --- a/src/armnn/test/UtilsTests.cpp +++ b/src/armnn/test/UtilsTests.cpp @@ -85,6 +85,25 @@ BOOST_AUTO_TEST_CASE(HalfType) BOOST_CHECK((GetDataTypeName(armnn::DataType::Float16) == std::string("Float16"))); } +BOOST_AUTO_TEST_CASE(BFloatType) +{ + armnn::BFloat16 a = 16256; + + // Test BFloat16 type + BOOST_CHECK_EQUAL(sizeof(a), 2); + + // Test utility function returns correct type. + using ResolvedType = armnn::ResolveType; + constexpr bool isBFloat16Type = std::is_same::value; + BOOST_CHECK(isBFloat16Type); + + //Test utility functions return correct size + BOOST_CHECK(GetDataTypeSize(armnn::DataType::BFloat16) == 2); + + //Test utility functions return correct name + BOOST_CHECK((GetDataTypeName(armnn::DataType::BFloat16) == std::string("BFloat16"))); +} + BOOST_AUTO_TEST_CASE(GraphTopologicalSortSimpleTest) { std::map> graph; -- cgit v1.2.1