diff options
Diffstat (limited to 'tests/framework')
-rw-r--r-- | tests/framework/Framework.cpp | 23 | ||||
-rw-r--r-- | tests/framework/Macros.h | 7 | ||||
-rw-r--r-- | tests/framework/TestCase.h | 1 |
3 files changed, 9 insertions, 22 deletions
diff --git a/tests/framework/Framework.cpp b/tests/framework/Framework.cpp index d1fb28d501..79a77d9e5e 100644 --- a/tests/framework/Framework.cpp +++ b/tests/framework/Framework.cpp @@ -25,16 +25,6 @@ #include "support/ToolchainSupport.h" -#ifdef ARM_COMPUTE_CL -#include "arm_compute/core/CL/OpenCL.h" -#include "arm_compute/runtime/CL/CLScheduler.h" -#endif /* ARM_COMPUTE_CL */ - -#ifdef ARM_COMPUTE_GC -#include "arm_compute/core/GLES_COMPUTE/OpenGLES.h" -#include "arm_compute/runtime/GLES_COMPUTE/GCScheduler.h" -#endif /* ARM_COMPUTE_GC */ - #include <chrono> #include <iostream> #include <sstream> @@ -310,18 +300,7 @@ void Framework::run_test(const TestInfo &info, TestCaseFactory &test_factory) profiler.start(); } test_case->do_run(); -#ifdef ARM_COMPUTE_CL - if(opencl_is_available()) - { - CLScheduler::get().sync(); - } -#endif /* ARM_COMPUTE_CL */ -#ifdef ARM_COMPUTE_GC - if(opengles31_is_available()) - { - GCScheduler::get().sync(); - } -#endif /* ARM_COMPUTE_GC */ + test_case->do_sync(); if(_num_iterations == 1 || i != 0) { profiler.stop(); diff --git a/tests/framework/Macros.h b/tests/framework/Macros.h index 7aabb75cfc..deca1ef51a 100644 --- a/tests/framework/Macros.h +++ b/tests/framework/Macros.h @@ -114,6 +114,11 @@ { \ FIXTURE::run(); \ } +#define FIXTURE_SYNC(FIXTURE) \ + void do_sync() override \ + { \ + FIXTURE::sync(); \ + } #define FIXTURE_TEARDOWN(FIXTURE) \ void do_teardown() override \ { \ @@ -223,6 +228,7 @@ TEST_CASE_CONSTRUCTOR(TEST_NAME) \ FIXTURE_SETUP(FIXTURE) \ FIXTURE_RUN(FIXTURE) \ + FIXTURE_SYNC(FIXTURE) \ FIXTURE_TEARDOWN(FIXTURE) \ }; \ TEST_REGISTRAR(TEST_NAME, MODE, STATUS) @@ -244,6 +250,7 @@ DATA_TEST_CASE_CONSTRUCTOR(TEST_NAME, DATASET) \ FIXTURE_DATA_SETUP(FIXTURE) \ FIXTURE_RUN(FIXTURE) \ + FIXTURE_SYNC(FIXTURE) \ FIXTURE_TEARDOWN(FIXTURE) \ }; \ DATA_TEST_REGISTRAR(TEST_NAME, MODE, STATUS, DATASET) diff --git a/tests/framework/TestCase.h b/tests/framework/TestCase.h index dbb9312dee..18dd12e442 100644 --- a/tests/framework/TestCase.h +++ b/tests/framework/TestCase.h @@ -42,6 +42,7 @@ class TestCase public: virtual void do_setup() {}; virtual void do_run() {}; + virtual void do_sync() {}; virtual void do_teardown() {}; /** Default destructor. */ |