13 #include <boost/test/unit_test.hpp> 35 template <
typename T, std::
size_t n>
38 bool testNameIndicatesUnsupported = testName.find(
"UNSUPPORTED") != std::string::npos;
39 BOOST_CHECK_MESSAGE(testNameIndicatesUnsupported != testResult.
supported,
40 "The test name does not match the supportedness it is reporting");
47 template <
typename T, std::
size_t n>
50 bool testNameIndicatesUnsupported = testName.find(
"UNSUPPORTED") != std::string::npos;
51 for (
unsigned int i = 0; i < testResult.size(); ++i)
53 BOOST_CHECK_MESSAGE(testNameIndicatesUnsupported != testResult[i].
supported,
54 "The test name does not match the supportedness it is reporting");
55 if (testResult[i].supported)
57 BOOST_TEST(
CompareTensors(testResult[i].output, testResult[i].outputExpected));
62 template<
typename FactoryType,
typename TFuncPtr,
typename... Args>
65 std::unique_ptr<armnn::Profiler> profiler = std::make_unique<armnn::Profiler>();
68 auto memoryManager = WorkloadFactoryHelper<FactoryType>::GetMemoryManager();
69 FactoryType workloadFactory = WorkloadFactoryHelper<FactoryType>::GetFactory(memoryManager);
71 auto testResult = (*testFunction)(workloadFactory, memoryManager, args...);
77 #define ARMNN_SIMPLE_TEST_CASE(TestName, TestFunction) \ 78 BOOST_AUTO_TEST_CASE(TestName) \ 83 #define ARMNN_AUTO_TEST_CASE(TestName, TestFunction, ...) \ 84 BOOST_AUTO_TEST_CASE(TestName) \ 86 RunTestFunction<FactoryType>(#TestName, &TestFunction, ##__VA_ARGS__); \ 89 template<
typename FactoryType,
typename TFuncPtr,
typename... Args>
92 auto memoryManager = WorkloadFactoryHelper<FactoryType>::GetMemoryManager();
93 FactoryType workloadFactory = WorkloadFactoryHelper<FactoryType>::GetFactory(memoryManager);
97 auto testResult = (*testFunction)(workloadFactory, memoryManager, refWorkloadFactory, args...);
101 #define ARMNN_COMPARE_REF_AUTO_TEST_CASE(TestName, TestFunction, ...) \ 102 BOOST_AUTO_TEST_CASE(TestName) \ 104 CompareRefTestFunction<FactoryType>(#TestName, &TestFunction, ##__VA_ARGS__); \ 107 #define ARMNN_COMPARE_REF_FIXTURE_TEST_CASE(TestName, Fixture, TestFunction, ...) \ 108 BOOST_FIXTURE_TEST_CASE(TestName, Fixture) \ 110 CompareRefTestFunction<FactoryType>(#TestName, &TestFunction, ##__VA_ARGS__); \
void RegisterProfiler(Profiler *profiler)
static ProfilerManager & GetInstance()
void ConfigureLogging(bool printToStandardOutput, bool printToDebugOutput, LogSeverity severity)
Configures the logging behaviour of the ARMNN library.
ISubgraphViewConverter supported
boost::test_tools::predicate_result CompareTensors(const boost::multi_array< T, n > &a, const boost::multi_array< T, n > &b, bool compareBoolean=false)
boost::multi_array< T, n > outputExpected
void CompareRefTestFunction(const char *testName, TFuncPtr testFunction, Args... args)
void RunTestFunction(const char *testName, TFuncPtr testFunction, Args... args)
void CompareTestResultIfSupported(const std::string &testName, const LayerTestResult< T, n > &testResult)
Executes BOOST_TEST on CompareTensors() return value so that the predicate_result message is reported...
void ConfigureLoggingTest()
boost::multi_array< T, n > output
ClWorkloadFactory FactoryType