src/armnn/test/ProfilingEventTest.cpp \
src/armnn/test/ObservableTest.cpp \
src/armnn/test/OptionalTest.cpp \
- src/backends/test/IsLayerSupportedTest.cpp \
- src/backends/test/Reference.cpp \
src/backends/test/WorkloadDataValidation.cpp \
src/backends/test/TensorCopyUtils.cpp \
src/backends/test/LayerTests.cpp \
- src/backends/test/CreateWorkloadRef.cpp \
- src/backends/test/ArmComputeCl.cpp \
- src/backends/test/ArmComputeNeon.cpp \
- src/backends/test/CreateWorkloadCl.cpp \
- src/backends/test/CreateWorkloadNeon.cpp \
- src/backends/test/MemCopyTests.cpp
+ src/backends/test/MemCopyTests.cpp \
+ src/backends/cl/test/ClCreateWorkloadTests.cpp \
+ src/backends/cl/test/ClLayerSupportTests.cpp \
+ src/backends/cl/test/ClLayerTests.cpp \
+ src/backends/neon/test/NeonCreateWorkloadTests.cpp \
+ src/backends/neon/test/NeonLayerSupportTests.cpp \
+ src/backends/neon/test/NeonLayerTests.cpp \
+ src/backends/reference/test/RefCreateWorkloadTests.cpp \
+ src/backends/reference/test/RefLayerSupportTests.cpp \
+ src/backends/reference/test/RefLayerTests.cpp
LOCAL_STATIC_LIBRARIES := \
libneuralnetworks_common \
src/armnn/test/InstrumentTests.cpp
src/armnn/test/ObservableTest.cpp
src/armnn/test/OptionalTest.cpp
- src/backends/test/IsLayerSupportedTest.cpp
src/backends/test/IsLayerSupportedTestImpl.hpp
- src/backends/test/Reference.cpp
src/backends/test/WorkloadDataValidation.cpp
src/backends/test/TensorCopyUtils.hpp
src/backends/test/TensorCopyUtils.cpp
src/backends/test/NormTestImpl.hpp
src/backends/test/BatchNormTestImpl.hpp
src/backends/test/WorkloadTestUtils.hpp
- src/backends/test/CreateWorkloadRef.cpp
src/backends/test/QuantizeHelper.hpp)
if(ARMCOMPUTENEON)
list(APPEND unittest_sources
- src/backends/test/ArmComputeNeon.cpp
- src/backends/test/CreateWorkloadNeon.cpp
src/armnn/test/CreateWorkloadClNeon.hpp
src/armnn/test/NeonTimerTest.cpp)
endif()
if(ARMCOMPUTECL)
list(APPEND unittest_sources
- src/backends/test/ArmComputeCl.cpp
- src/backends/test/ClContextControlFixture.hpp
- src/backends/test/CreateWorkloadCl.cpp
src/armnn/test/CreateWorkloadClNeon.hpp
src/armnn/test/OpenClTimerTest.cpp
src/armnn/test/FP16SupportTest.cpp)
endif()
endif()
- target_link_libraries(UnitTests armnn)
- target_link_libraries(UnitTests armnnUtils)
+ # the backends under src/backends extend the list of
+ # static libs UnitTests to link against
+ list(APPEND armnnUnitTestLibraries armnn armnnUtils)
+
+ foreach(lib ${armnnUnitTestLibraries})
+ target_link_libraries(UnitTests ${lib})
+ message("Adding library dependency to UnitTests: ${lib}")
+ endforeach()
+
target_link_libraries(UnitTests ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(UnitTests ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_FILESYSTEM_LIBRARY})
#include <boost/cast.hpp>
#include <backends/WorkloadData.hpp>
+#include <backends/WorkloadFactory.hpp>
#include <backends/CpuTensorHandle.hpp>
#include <Graph.hpp>
#pragma once
#include "CreateWorkload.hpp"
+
+#include <backends/MemCopyWorkload.hpp>
#include <backends/reference/RefWorkloadFactory.hpp>
#if ARMCOMPUTECL_ENABLED
#include <armnn/Descriptors.hpp>
#include <armnn/IRuntime.hpp>
#include <armnn/INetwork.hpp>
-#include <backends/test/ClContextControlFixture.hpp>
+#include <backends/cl/test/ClContextControlFixture.hpp>
#include <backends/cl/ClWorkloadFactory.hpp>
BOOST_FIXTURE_TEST_SUITE(JsonPrinterTests, ClProfilingContextControlFixture)
)
if(ARMCOMPUTECL)
- add_subdirectory(workloads test)
+ add_subdirectory(workloads)
+ add_subdirectory(test)
endif()
add_library(armnnClBackend STATIC ${armnnClBackend_sources})
if(ARMCOMPUTECL)
add_subdirectory(${PROJECT_SOURCE_DIR}/src/backends/cl)
list(APPEND armnnLibraries armnnClBackend armnnClBackendWorkloads)
+ list(APPEND armnnUnitTestLibraries armnnClBackendUnitTests)
else()
message("CL backend is disabled")
add_subdirectory(${PROJECT_SOURCE_DIR}/src/backends/cl)
+#
+# Copyright © 2017 Arm Ltd. All rights reserved.
+# SPDX-License-Identifier: MIT
+#
+
+list(APPEND armnnClBackendUnitTests_sources
+ ClContextControlFixture.hpp
+ ClCreateWorkloadTests.cpp
+ ClLayerSupportTests.cpp
+ ClLayerTests.cpp
+)
+
+add_library(armnnClBackendUnitTests STATIC ${armnnClBackendUnitTests_sources})
+target_include_directories(armnnClBackendUnitTests PRIVATE ${PROJECT_SOURCE_DIR}/src)
+target_include_directories(armnnClBackendUnitTests PRIVATE ${PROJECT_SOURCE_DIR}/src/armnn)
+target_include_directories(armnnClBackendUnitTests PRIVATE ${PROJECT_SOURCE_DIR}/src/armnnUtils)
\ No newline at end of file
// Copyright © 2017 Arm Ltd. All rights reserved.
// SPDX-License-Identifier: MIT
//
-#include <backends/cl/ClWorkloadFactory.hpp>
-#include <backends/reference/RefWorkloadFactory.hpp>
+
+#include "ClContextControlFixture.hpp"
+
#include <backends/MemCopyWorkload.hpp>
-#include <backends/cl/workloads/ClWorkloadUtils.hpp>
-#include <backends/cl/workloads/ClWorkloads.hpp>
#include <backends/cl/ClTensorHandle.hpp>
-#include "ClContextControlFixture.hpp"
+#include <backends/cl/ClWorkloadFactory.hpp>
+#include <backends/cl/workloads/ClWorkloads.hpp>
+#include <backends/cl/workloads/ClWorkloadUtils.hpp>
+#include <backends/reference/RefWorkloadFactory.hpp>
#include <test/CreateWorkloadClNeon.hpp>
--- /dev/null
+//
+// Copyright © 2017 Arm Ltd. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+
+#include <armnn/layers/ConvertFp16ToFp32Layer.hpp>
+#include <armnn/layers/ConvertFp32ToFp16Layer.hpp>
+#include <armnn/test/TensorHelpers.hpp>
+
+#include <backends/CpuTensorHandle.hpp>
+#include <backends/cl/ClWorkloadFactory.hpp>
+#include <backends/cl/test/ClContextControlFixture.hpp>
+#include <backends/test/IsLayerSupportedTestImpl.hpp>
+#include <backends/test/LayerTests.hpp>
+
+#include <boost/test/unit_test.hpp>
+
+#include <string>
+
+BOOST_AUTO_TEST_SUITE(ClLayerSupport)
+
+BOOST_FIXTURE_TEST_CASE(IsLayerSupportedFloat16Cl, ClContextControlFixture)
+{
+ armnn::ClWorkloadFactory factory;
+ IsLayerSupportedTests<armnn::ClWorkloadFactory, armnn::DataType::Float16>(&factory);
+}
+
+BOOST_FIXTURE_TEST_CASE(IsLayerSupportedFloat32Cl, ClContextControlFixture)
+{
+ armnn::ClWorkloadFactory factory;
+ IsLayerSupportedTests<armnn::ClWorkloadFactory, armnn::DataType::Float32>(&factory);
+}
+
+BOOST_FIXTURE_TEST_CASE(IsLayerSupportedUint8Cl, ClContextControlFixture)
+{
+ armnn::ClWorkloadFactory factory;
+ IsLayerSupportedTests<armnn::ClWorkloadFactory, armnn::DataType::QuantisedAsymm8>(&factory);
+}
+
+BOOST_FIXTURE_TEST_CASE(IsConvertFp16ToFp32SupportedCl, ClContextControlFixture)
+{
+ std::string reasonIfUnsupported;
+
+ bool result = IsConvertLayerSupportedTests<armnn::ClWorkloadFactory, armnn::ConvertFp16ToFp32Layer,
+ armnn::DataType::Float16, armnn::DataType::Float32>(reasonIfUnsupported);
+
+ BOOST_CHECK(result);
+}
+
+BOOST_FIXTURE_TEST_CASE(IsConvertFp16ToFp32SupportedFp32InputCl, ClContextControlFixture)
+{
+ std::string reasonIfUnsupported;
+
+ bool result = IsConvertLayerSupportedTests<armnn::ClWorkloadFactory, armnn::ConvertFp16ToFp32Layer,
+ armnn::DataType::Float32, armnn::DataType::Float32>(reasonIfUnsupported);
+
+ BOOST_CHECK(!result);
+ BOOST_CHECK_EQUAL(reasonIfUnsupported, "Input should be Float16");
+}
+
+BOOST_FIXTURE_TEST_CASE(IsConvertFp16ToFp32SupportedFp16OutputCl, ClContextControlFixture)
+{
+ std::string reasonIfUnsupported;
+
+ bool result = IsConvertLayerSupportedTests<armnn::ClWorkloadFactory, armnn::ConvertFp16ToFp32Layer,
+ armnn::DataType::Float16, armnn::DataType::Float16>(reasonIfUnsupported);
+
+ BOOST_CHECK(!result);
+ BOOST_CHECK_EQUAL(reasonIfUnsupported, "Output should be Float32");
+}
+
+BOOST_FIXTURE_TEST_CASE(IsConvertFp32ToFp16SupportedCl, ClContextControlFixture)
+{
+ std::string reasonIfUnsupported;
+
+ bool result = IsConvertLayerSupportedTests<armnn::ClWorkloadFactory, armnn::ConvertFp32ToFp16Layer,
+ armnn::DataType::Float32, armnn::DataType::Float16>(reasonIfUnsupported);
+
+ BOOST_CHECK(result);
+}
+
+BOOST_FIXTURE_TEST_CASE(IsConvertFp32ToFp16SupportedFp16InputCl, ClContextControlFixture)
+{
+ std::string reasonIfUnsupported;
+
+ bool result = IsConvertLayerSupportedTests<armnn::ClWorkloadFactory, armnn::ConvertFp32ToFp16Layer,
+ armnn::DataType::Float16, armnn::DataType::Float16>(reasonIfUnsupported);
+
+ BOOST_CHECK(!result);
+ BOOST_CHECK_EQUAL(reasonIfUnsupported, "Input should be Float32");
+}
+
+BOOST_FIXTURE_TEST_CASE(IsConvertFp32ToFp16SupportedFp32OutputCl, ClContextControlFixture)
+{
+ std::string reasonIfUnsupported;
+
+ bool result = IsConvertLayerSupportedTests<armnn::ClWorkloadFactory, armnn::ConvertFp32ToFp16Layer,
+ armnn::DataType::Float32, armnn::DataType::Float32>(reasonIfUnsupported);
+
+ BOOST_CHECK(!result);
+ BOOST_CHECK_EQUAL(reasonIfUnsupported, "Output should be Float16");
+}
+
+BOOST_AUTO_TEST_SUITE_END()
// Copyright © 2017 Arm Ltd. All rights reserved.
// SPDX-License-Identifier: MIT
//
-#include <boost/test/unit_test.hpp>
+
+#include "ClContextControlFixture.hpp"
+
#include "test/TensorHelpers.hpp"
-#include "LayerTests.hpp"
+#include "test/UnitTests.hpp"
#include <backends/CpuTensorHandle.hpp>
+#include <backends/cl/ClLayerSupport.hpp>
#include <backends/cl/ClWorkloadFactory.hpp>
#include <backends/cl/workloads/ClWorkloadUtils.hpp>
#include <backends/reference/RefWorkloadFactory.hpp>
-#include <backends/cl/ClLayerSupport.hpp>
-#include "ActivationFixture.hpp"
-#include "ClContextControlFixture.hpp"
+#include <backends/test/ActivationFixture.hpp>
+#include <backends/test/LayerTests.hpp>
#include <arm_compute/core/CL/CLKernelLibrary.h>
#include <arm_compute/runtime/CL/CLScheduler.h>
-#include <string>
-#include <iostream>
-#include "test/UnitTests.hpp"
+#include <boost/test/unit_test.hpp>
+
+#include <iostream>
+#include <string>
BOOST_FIXTURE_TEST_SUITE(Compute_ArmComputeCl, ClContextControlFixture)
using FactoryType = armnn::ClWorkloadFactory;
NeonTensorHandle.hpp
)
- add_subdirectory(workloads test)
+ add_subdirectory(workloads)
+ add_subdirectory(test)
else()
list(APPEND armnnNeonBackend_sources
NeonLayerSupport.cpp
if(ARMCOMPUTENEON)
add_subdirectory(${PROJECT_SOURCE_DIR}/src/backends/neon)
list(APPEND armnnLibraries armnnNeonBackend armnnNeonBackendWorkloads)
+ list(APPEND armnnUnitTestLibraries armnnNeonBackendUnitTests)
else()
message("NEON backend is disabled")
add_subdirectory(${PROJECT_SOURCE_DIR}/src/backends/neon)
# Copyright © 2017 Arm Ltd. All rights reserved.
# SPDX-License-Identifier: MIT
#
+
+list(APPEND armnnNeonBackendUnitTests_sources
+ NeonCreateWorkloadTests.cpp
+ NeonLayerSupportTests.cpp
+ NeonLayerTests.cpp
+)
+
+add_library(armnnNeonBackendUnitTests STATIC ${armnnNeonBackendUnitTests_sources})
+target_include_directories(armnnNeonBackendUnitTests PRIVATE ${PROJECT_SOURCE_DIR}/src)
+target_include_directories(armnnNeonBackendUnitTests PRIVATE ${PROJECT_SOURCE_DIR}/src/armnn)
+target_include_directories(armnnNeonBackendUnitTests PRIVATE ${PROJECT_SOURCE_DIR}/src/armnnUtils)
\ No newline at end of file
// Copyright © 2017 Arm Ltd. All rights reserved.
// SPDX-License-Identifier: MIT
//
+
+#include <armnn/test/CreateWorkloadClNeon.hpp>
+
+#include <backends/MemCopyWorkload.hpp>
#include <backends/neon/NeonWorkloadFactory.hpp>
#include <backends/neon/NeonTensorHandle.hpp>
#include <backends/neon/workloads/NeonWorkloadUtils.hpp>
#include <backends/neon/workloads/NeonWorkloads.hpp>
-#include <backends/MemCopyWorkload.hpp>
-
-#include "test/CreateWorkloadClNeon.hpp"
BOOST_AUTO_TEST_SUITE(CreateWorkloadNeon)
--- /dev/null
+//
+// Copyright © 2017 Arm Ltd. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+
+#include <armnn/layers/ConvertFp16ToFp32Layer.hpp>
+#include <armnn/layers/ConvertFp32ToFp16Layer.hpp>
+#include <armnn/test/TensorHelpers.hpp>
+
+#include <backends/CpuTensorHandle.hpp>
+#include <backends/neon/NeonWorkloadFactory.hpp>
+#include <backends/test/IsLayerSupportedTestImpl.hpp>
+#include <backends/test/LayerTests.hpp>
+
+#include <boost/test/unit_test.hpp>
+
+#include <string>
+
+BOOST_AUTO_TEST_SUITE(NeonLayerSupport)
+
+BOOST_AUTO_TEST_CASE(IsLayerSupportedFloat16Neon)
+{
+ armnn::NeonWorkloadFactory factory;
+ IsLayerSupportedTests<armnn::NeonWorkloadFactory, armnn::DataType::Float16>(&factory);
+}
+
+BOOST_AUTO_TEST_CASE(IsLayerSupportedFloat32Neon)
+{
+ armnn::NeonWorkloadFactory factory;
+ IsLayerSupportedTests<armnn::NeonWorkloadFactory, armnn::DataType::Float32>(&factory);
+}
+
+BOOST_AUTO_TEST_CASE(IsLayerSupportedUint8Neon)
+{
+ armnn::NeonWorkloadFactory factory;
+ IsLayerSupportedTests<armnn::NeonWorkloadFactory, armnn::DataType::QuantisedAsymm8>(&factory);
+}
+
+BOOST_AUTO_TEST_CASE(IsConvertFp16ToFp32SupportedNeon)
+{
+ std::string reasonIfUnsupported;
+
+ bool result = IsConvertLayerSupportedTests<armnn::NeonWorkloadFactory, armnn::ConvertFp16ToFp32Layer,
+ armnn::DataType::Float16, armnn::DataType::Float32>(reasonIfUnsupported);
+
+ BOOST_CHECK(result);
+}
+
+BOOST_AUTO_TEST_CASE(IsConvertFp32ToFp16SupportedNeon)
+{
+ std::string reasonIfUnsupported;
+
+ bool result = IsConvertLayerSupportedTests<armnn::NeonWorkloadFactory, armnn::ConvertFp32ToFp16Layer,
+ armnn::DataType::Float32, armnn::DataType::Float16>(reasonIfUnsupported);
+
+ BOOST_CHECK(result);
+}
+
+BOOST_AUTO_TEST_SUITE_END()
// Copyright © 2017 Arm Ltd. All rights reserved.
// SPDX-License-Identifier: MIT
//
-#include <boost/test/unit_test.hpp>
-#include "test/TensorHelpers.hpp"
-#include "LayerTests.hpp"
+#include <armnn/test/TensorHelpers.hpp>
+#include <armnn/test/UnitTests.hpp>
#include <backends/CpuTensorHandle.hpp>
#include <backends/neon/NeonLayerSupport.hpp>
#include <backends/neon/NeonWorkloadFactory.hpp>
#include <backends/reference/RefWorkloadFactory.hpp>
+#include <backends/test/ActivationFixture.hpp>
+#include <backends/test/LayerTests.hpp>
#include <backends/test/TensorCopyUtils.hpp>
-#include "ActivationFixture.hpp"
-
-#include "WorkloadTestUtils.hpp"
+#include <backends/test/WorkloadTestUtils.hpp>
-#include "test/UnitTests.hpp"
+#include <boost/test/unit_test.hpp>
BOOST_AUTO_TEST_SUITE(Compute_ArmComputeNeon)
using FactoryType = armnn::NeonWorkloadFactory;
target_include_directories(armnnRefBackend PRIVATE ${PROJECT_SOURCE_DIR}/src/armnn)
target_include_directories(armnnRefBackend PRIVATE ${PROJECT_SOURCE_DIR}/src/armnnUtils)
-add_subdirectory(workloads test)
-
+add_subdirectory(workloads)
+add_subdirectory(test)
add_subdirectory(${PROJECT_SOURCE_DIR}/src/backends/reference)
list(APPEND armnnLibraries armnnRefBackend armnnRefBackendWorkloads)
+list(APPEND armnnUnitTestLibraries armnnRefBackendUnitTests)
# Copyright © 2017 Arm Ltd. All rights reserved.
# SPDX-License-Identifier: MIT
#
+
+list(APPEND armnnRefBackendUnitTests_sources
+ RefCreateWorkloadTests.cpp
+ RefLayerSupportTests.cpp
+ RefLayerTests.cpp
+)
+
+add_library(armnnRefBackendUnitTests STATIC ${armnnRefBackendUnitTests_sources})
+target_include_directories(armnnRefBackendUnitTests PRIVATE ${PROJECT_SOURCE_DIR}/src)
+target_include_directories(armnnRefBackendUnitTests PRIVATE ${PROJECT_SOURCE_DIR}/src/armnn)
+target_include_directories(armnnRefBackendUnitTests PRIVATE ${PROJECT_SOURCE_DIR}/src/armnnUtils)
\ No newline at end of file
// Copyright © 2017 Arm Ltd. All rights reserved.
// SPDX-License-Identifier: MIT
//
+
+#include <armnn/test/CreateWorkload.hpp>
+
+#include <backends/CpuTensorHandle.hpp>
#include <backends/reference/RefWorkloadFactory.hpp>
#include <backends/reference/workloads/RefWorkloads.hpp>
-#include <backends/CpuTensorHandle.hpp>
-
-#include "test/CreateWorkload.hpp"
namespace
{
--- /dev/null
+//
+// Copyright © 2017 Arm Ltd. All rights reserved.
+// SPDX-License-Identifier: MIT
+//
+
+#include <armnn/layers/ConvertFp16ToFp32Layer.hpp>
+#include <armnn/layers/ConvertFp32ToFp16Layer.hpp>
+#include <armnn/test/TensorHelpers.hpp>
+
+#include <backends/CpuTensorHandle.hpp>
+#include <backends/reference/RefWorkloadFactory.hpp>
+#include <backends/test/LayerTests.hpp>
+#include <backends/test/IsLayerSupportedTestImpl.hpp>
+
+#include <boost/test/unit_test.hpp>
+
+#include <string>
+
+namespace
+{
+
+bool LayerTypeMatchesTest()
+{
+ return LayerTypeMatchesTestImpl<armnn::LayerType::FirstLayer>(Tag<armnn::LayerType::FirstLayer>());
+};
+
+} // anonymous namespace
+
+BOOST_AUTO_TEST_SUITE(RefLayerSupported)
+
+BOOST_AUTO_TEST_CASE(IsLayerSupportedLayerTypeMatches)
+{
+ LayerTypeMatchesTest();
+}
+
+BOOST_AUTO_TEST_CASE(IsLayerSupportedFloat16Reference)
+{
+ armnn::RefWorkloadFactory factory;
+ IsLayerSupportedTests<armnn::RefWorkloadFactory, armnn::DataType::Float16>(&factory);
+}
+
+BOOST_AUTO_TEST_CASE(IsLayerSupportedFloat32Reference)
+{
+ armnn::RefWorkloadFactory factory;
+ IsLayerSupportedTests<armnn::RefWorkloadFactory, armnn::DataType::Float32>(&factory);
+}
+
+BOOST_AUTO_TEST_CASE(IsLayerSupportedUint8Reference)
+{
+ armnn::RefWorkloadFactory factory;
+ IsLayerSupportedTests<armnn::RefWorkloadFactory, armnn::DataType::QuantisedAsymm8>(&factory);
+}
+
+BOOST_AUTO_TEST_CASE(IsConvertFp16ToFp32SupportedReference)
+{
+ std::string reasonIfUnsupported;
+
+ bool result = IsConvertLayerSupportedTests<armnn::RefWorkloadFactory, armnn::ConvertFp16ToFp32Layer,
+ armnn::DataType::Float16, armnn::DataType::Float32>(reasonIfUnsupported);
+
+ BOOST_CHECK(result);
+}
+
+BOOST_AUTO_TEST_CASE(IsConvertFp16ToFp32SupportedFp32InputReference)
+{
+ std::string reasonIfUnsupported;
+
+ bool result = IsConvertLayerSupportedTests<armnn::RefWorkloadFactory, armnn::ConvertFp16ToFp32Layer,
+ armnn::DataType::Float32, armnn::DataType::Float32>(reasonIfUnsupported);
+
+ BOOST_CHECK(!result);
+ BOOST_CHECK_EQUAL(reasonIfUnsupported, "Layer is not supported with float32 data type input");
+}
+
+BOOST_AUTO_TEST_CASE(IsConvertFp16ToFp32SupportedFp16OutputReference)
+{
+ std::string reasonIfUnsupported;
+
+ bool result = IsConvertLayerSupportedTests<armnn::RefWorkloadFactory, armnn::ConvertFp16ToFp32Layer,
+ armnn::DataType::Float16, armnn::DataType::Float16>(reasonIfUnsupported);
+
+ BOOST_CHECK(!result);
+ BOOST_CHECK_EQUAL(reasonIfUnsupported, "Layer is not supported with float16 data type output");
+}
+
+BOOST_AUTO_TEST_CASE(IsConvertFp32ToFp16SupportedReference)
+{
+ std::string reasonIfUnsupported;
+
+ bool result = IsConvertLayerSupportedTests<armnn::RefWorkloadFactory, armnn::ConvertFp32ToFp16Layer,
+ armnn::DataType::Float32, armnn::DataType::Float16>(reasonIfUnsupported);
+
+ BOOST_CHECK(result);
+}
+
+BOOST_AUTO_TEST_CASE(IsConvertFp32ToFp16SupportedFp16InputReference)
+{
+ std::string reasonIfUnsupported;
+
+ bool result = IsConvertLayerSupportedTests<armnn::RefWorkloadFactory, armnn::ConvertFp32ToFp16Layer,
+ armnn::DataType::Float16, armnn::DataType::Float16>(reasonIfUnsupported);
+
+ BOOST_CHECK(!result);
+ BOOST_CHECK_EQUAL(reasonIfUnsupported, "Layer is not supported with float16 data type input");
+}
+
+BOOST_AUTO_TEST_CASE(IsConvertFp32ToFp16SupportedFp32OutputReference)
+{
+ std::string reasonIfUnsupported;
+
+ bool result = IsConvertLayerSupportedTests<armnn::RefWorkloadFactory, armnn::ConvertFp32ToFp16Layer,
+ armnn::DataType::Float32, armnn::DataType::Float32>(reasonIfUnsupported);
+
+ BOOST_CHECK(!result);
+ BOOST_CHECK_EQUAL(reasonIfUnsupported, "Layer is not supported with float32 data type output");
+}
+
+BOOST_AUTO_TEST_SUITE_END()
// Copyright © 2017 Arm Ltd. All rights reserved.
// SPDX-License-Identifier: MIT
//
-#include <boost/test/unit_test.hpp>
-#include "LayerTests.hpp"
#include "test/TensorHelpers.hpp"
+#include "test/UnitTests.hpp"
#include <backends/reference/RefWorkloadFactory.hpp>
+#include <backends/test/LayerTests.hpp>
-#include "test/UnitTests.hpp"
+#include <boost/test/unit_test.hpp>
BOOST_AUTO_TEST_SUITE(Compute_Reference)
using FactoryType = armnn::RefWorkloadFactory;
#include "TensorCopyUtils.hpp"
#include "WorkloadTestUtils.hpp"
+#include <armnn/test/TensorHelpers.hpp>
+
+#include <boost/numeric/conversion/cast.hpp>
+#include <boost/multi_array.hpp>
+
struct ActivationFixture
{
ActivationFixture()
+++ /dev/null
-//
-// Copyright © 2017 Arm Ltd. All rights reserved.
-// SPDX-License-Identifier: MIT
-//
-#include <boost/test/unit_test.hpp>
-
-#include <test/TensorHelpers.hpp>
-#include "LayerTests.hpp"
-
-#include <backends/CpuTensorHandle.hpp>
-#include <backends/reference/RefWorkloadFactory.hpp>
-#include <backends/neon/NeonWorkloadFactory.hpp>
-
-#include <string>
-#include <iostream>
-#include <backends/cl/ClWorkloadFactory.hpp>
-
-#include "IsLayerSupportedTestImpl.hpp"
-#include <backends/test/ClContextControlFixture.hpp>
-
-#include <layers/ConvertFp16ToFp32Layer.hpp>
-#include <layers/ConvertFp32ToFp16Layer.hpp>
-
-BOOST_AUTO_TEST_SUITE(IsLayerSupported)
-
-BOOST_AUTO_TEST_CASE(IsLayerSupportedLayerTypeMatches)
-{
- LayerTypeMatchesTest();
-}
-
-BOOST_AUTO_TEST_CASE(IsLayerSupportedFloat16Reference)
-{
- armnn::RefWorkloadFactory factory;
- IsLayerSupportedTests<armnn::RefWorkloadFactory, armnn::DataType::Float16>(&factory);
-}
-
-BOOST_AUTO_TEST_CASE(IsLayerSupportedFloat32Reference)
-{
- armnn::RefWorkloadFactory factory;
- IsLayerSupportedTests<armnn::RefWorkloadFactory, armnn::DataType::Float32>(&factory);
-}
-
-BOOST_AUTO_TEST_CASE(IsLayerSupportedUint8Reference)
-{
- armnn::RefWorkloadFactory factory;
- IsLayerSupportedTests<armnn::RefWorkloadFactory, armnn::DataType::QuantisedAsymm8>(&factory);
-}
-
-BOOST_AUTO_TEST_CASE(IsConvertFp16ToFp32SupportedReference)
-{
- std::string reasonIfUnsupported;
-
- bool result = IsConvertLayerSupportedTests<armnn::RefWorkloadFactory, armnn::ConvertFp16ToFp32Layer,
- armnn::DataType::Float16, armnn::DataType::Float32>(reasonIfUnsupported);
-
- BOOST_CHECK(result);
-}
-
-BOOST_AUTO_TEST_CASE(IsConvertFp16ToFp32SupportedFp32InputReference)
-{
- std::string reasonIfUnsupported;
-
- bool result = IsConvertLayerSupportedTests<armnn::RefWorkloadFactory, armnn::ConvertFp16ToFp32Layer,
- armnn::DataType::Float32, armnn::DataType::Float32>(reasonIfUnsupported);
-
- BOOST_CHECK(!result);
- BOOST_CHECK_EQUAL(reasonIfUnsupported, "Layer is not supported with float32 data type input");
-}
-
-BOOST_AUTO_TEST_CASE(IsConvertFp16ToFp32SupportedFp16OutputReference)
-{
- std::string reasonIfUnsupported;
-
- bool result = IsConvertLayerSupportedTests<armnn::RefWorkloadFactory, armnn::ConvertFp16ToFp32Layer,
- armnn::DataType::Float16, armnn::DataType::Float16>(reasonIfUnsupported);
-
- BOOST_CHECK(!result);
- BOOST_CHECK_EQUAL(reasonIfUnsupported, "Layer is not supported with float16 data type output");
-}
-
-BOOST_AUTO_TEST_CASE(IsConvertFp32ToFp16SupportedReference)
-{
- std::string reasonIfUnsupported;
-
- bool result = IsConvertLayerSupportedTests<armnn::RefWorkloadFactory, armnn::ConvertFp32ToFp16Layer,
- armnn::DataType::Float32, armnn::DataType::Float16>(reasonIfUnsupported);
-
- BOOST_CHECK(result);
-}
-
-BOOST_AUTO_TEST_CASE(IsConvertFp32ToFp16SupportedFp16InputReference)
-{
- std::string reasonIfUnsupported;
-
- bool result = IsConvertLayerSupportedTests<armnn::RefWorkloadFactory, armnn::ConvertFp32ToFp16Layer,
- armnn::DataType::Float16, armnn::DataType::Float16>(reasonIfUnsupported);
-
- BOOST_CHECK(!result);
- BOOST_CHECK_EQUAL(reasonIfUnsupported, "Layer is not supported with float16 data type input");
-}
-
-BOOST_AUTO_TEST_CASE(IsConvertFp32ToFp16SupportedFp32OutputReference)
-{
- std::string reasonIfUnsupported;
-
- bool result = IsConvertLayerSupportedTests<armnn::RefWorkloadFactory, armnn::ConvertFp32ToFp16Layer,
- armnn::DataType::Float32, armnn::DataType::Float32>(reasonIfUnsupported);
-
- BOOST_CHECK(!result);
- BOOST_CHECK_EQUAL(reasonIfUnsupported, "Layer is not supported with float32 data type output");
-}
-
-#ifdef ARMCOMPUTENEON_ENABLED
-BOOST_AUTO_TEST_CASE(IsLayerSupportedFloat16Neon)
-{
- armnn::NeonWorkloadFactory factory;
- IsLayerSupportedTests<armnn::NeonWorkloadFactory, armnn::DataType::Float16>(&factory);
-}
-
-BOOST_AUTO_TEST_CASE(IsLayerSupportedFloat32Neon)
-{
- armnn::NeonWorkloadFactory factory;
- IsLayerSupportedTests<armnn::NeonWorkloadFactory, armnn::DataType::Float32>(&factory);
-}
-
-BOOST_AUTO_TEST_CASE(IsLayerSupportedUint8Neon)
-{
- armnn::NeonWorkloadFactory factory;
- IsLayerSupportedTests<armnn::NeonWorkloadFactory, armnn::DataType::QuantisedAsymm8>(&factory);
-}
-
-BOOST_AUTO_TEST_CASE(IsConvertFp16ToFp32SupportedNeon)
-{
- std::string reasonIfUnsupported;
-
- bool result = IsConvertLayerSupportedTests<armnn::NeonWorkloadFactory, armnn::ConvertFp16ToFp32Layer,
- armnn::DataType::Float16, armnn::DataType::Float32>(reasonIfUnsupported);
-
- BOOST_CHECK(result);
-}
-
-BOOST_AUTO_TEST_CASE(IsConvertFp32ToFp16SupportedNeon)
-{
- std::string reasonIfUnsupported;
-
- bool result = IsConvertLayerSupportedTests<armnn::NeonWorkloadFactory, armnn::ConvertFp32ToFp16Layer,
- armnn::DataType::Float32, armnn::DataType::Float16>(reasonIfUnsupported);
-
- BOOST_CHECK(result);
-}
-#endif //#ifdef ARMCOMPUTENEON_ENABLED.
-
-
-#ifdef ARMCOMPUTECL_ENABLED
-
-BOOST_FIXTURE_TEST_CASE(IsLayerSupportedFloat16Cl, ClContextControlFixture)
-{
- armnn::ClWorkloadFactory factory;
- IsLayerSupportedTests<armnn::ClWorkloadFactory, armnn::DataType::Float16>(&factory);
-}
-
-BOOST_FIXTURE_TEST_CASE(IsLayerSupportedFloat32Cl, ClContextControlFixture)
-{
- armnn::ClWorkloadFactory factory;
- IsLayerSupportedTests<armnn::ClWorkloadFactory, armnn::DataType::Float32>(&factory);
-}
-
-BOOST_FIXTURE_TEST_CASE(IsLayerSupportedUint8Cl, ClContextControlFixture)
-{
- armnn::ClWorkloadFactory factory;
- IsLayerSupportedTests<armnn::ClWorkloadFactory, armnn::DataType::QuantisedAsymm8>(&factory);
-}
-
-BOOST_FIXTURE_TEST_CASE(IsConvertFp16ToFp32SupportedCl, ClContextControlFixture)
-{
- std::string reasonIfUnsupported;
-
- bool result = IsConvertLayerSupportedTests<armnn::ClWorkloadFactory, armnn::ConvertFp16ToFp32Layer,
- armnn::DataType::Float16, armnn::DataType::Float32>(reasonIfUnsupported);
-
- BOOST_CHECK(result);
-}
-
-BOOST_FIXTURE_TEST_CASE(IsConvertFp16ToFp32SupportedFp32InputCl, ClContextControlFixture)
-{
- std::string reasonIfUnsupported;
-
- bool result = IsConvertLayerSupportedTests<armnn::ClWorkloadFactory, armnn::ConvertFp16ToFp32Layer,
- armnn::DataType::Float32, armnn::DataType::Float32>(reasonIfUnsupported);
-
- BOOST_CHECK(!result);
- BOOST_CHECK_EQUAL(reasonIfUnsupported, "Input should be Float16");
-}
-
-BOOST_FIXTURE_TEST_CASE(IsConvertFp16ToFp32SupportedFp16OutputCl, ClContextControlFixture)
-{
- std::string reasonIfUnsupported;
-
- bool result = IsConvertLayerSupportedTests<armnn::ClWorkloadFactory, armnn::ConvertFp16ToFp32Layer,
- armnn::DataType::Float16, armnn::DataType::Float16>(reasonIfUnsupported);
-
- BOOST_CHECK(!result);
- BOOST_CHECK_EQUAL(reasonIfUnsupported, "Output should be Float32");
-}
-
-BOOST_FIXTURE_TEST_CASE(IsConvertFp32ToFp16SupportedCl, ClContextControlFixture)
-{
- std::string reasonIfUnsupported;
-
- bool result = IsConvertLayerSupportedTests<armnn::ClWorkloadFactory, armnn::ConvertFp32ToFp16Layer,
- armnn::DataType::Float32, armnn::DataType::Float16>(reasonIfUnsupported);
-
- BOOST_CHECK(result);
-}
-
-BOOST_FIXTURE_TEST_CASE(IsConvertFp32ToFp16SupportedFp16InputCl, ClContextControlFixture)
-{
- std::string reasonIfUnsupported;
-
- bool result = IsConvertLayerSupportedTests<armnn::ClWorkloadFactory, armnn::ConvertFp32ToFp16Layer,
- armnn::DataType::Float16, armnn::DataType::Float16>(reasonIfUnsupported);
-
- BOOST_CHECK(!result);
- BOOST_CHECK_EQUAL(reasonIfUnsupported, "Input should be Float32");
-}
-
-BOOST_FIXTURE_TEST_CASE(IsConvertFp32ToFp16SupportedFp32OutputCl, ClContextControlFixture)
-{
- std::string reasonIfUnsupported;
-
- bool result = IsConvertLayerSupportedTests<armnn::ClWorkloadFactory, armnn::ConvertFp32ToFp16Layer,
- armnn::DataType::Float32, armnn::DataType::Float32>(reasonIfUnsupported);
-
- BOOST_CHECK(!result);
- BOOST_CHECK_EQUAL(reasonIfUnsupported, "Output should be Float16");
-}
-#endif //#ifdef ARMCOMPUTECL_ENABLED.
-
-BOOST_AUTO_TEST_SUITE_END()
LayerTypeMatchesTestImpl<NextType(Type)>(Tag<NextType(Type)>());
};
-bool LayerTypeMatchesTest()
-{
- return LayerTypeMatchesTestImpl<armnn::LayerType::FirstLayer>(Tag<armnn::LayerType::FirstLayer>());
-};
-
template<typename FactoryType, typename LayerType, armnn::DataType InputDataType , armnn::DataType OutputDataType>
bool IsConvertLayerSupportedTests(std::string& reasonIfUnsupported)
{
#include "ConvertFp16ToFp32TestImpl.hpp"
#include "ConvertFp32ToFp16TestImpl.hpp"
-#include "ClContextControlFixture.hpp"
+#include <backends/cl/test/ClContextControlFixture.hpp>
// 3-channel 16x8 image used as common input data for a number of Conv2d tests.
static std::vector<float> ConvInput3x8x16({