aboutsummaryrefslogtreecommitdiff
path: root/tests/framework
diff options
context:
space:
mode:
authorJoel Liang <joel.liang@arm.com>2017-12-28 10:09:51 +0800
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:42:33 +0000
commit1c5ffd612979d40730feecc4f43fa6c9f177f2e3 (patch)
tree510367ba70fcad4374d2cf9cdccdb3bc715c216c /tests/framework
parentc5a7e59655b61ad617fa34a4fb00e1a007c8255a (diff)
downloadComputeLibrary-1c5ffd612979d40730feecc4f43fa6c9f177f2e3.tar.gz
APPBROWSER-359: Sync tensor in GC benchmark tests
Change-Id: I22c1aa92e70d6143bbcec90e9e7de9f1ce1c1e55 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/114635 Tested-by: Jenkins <bsgcomp@arm.com> Reviewed-by: Pablo Tello <pablo.tello@arm.com>
Diffstat (limited to 'tests/framework')
-rw-r--r--tests/framework/Framework.cpp23
-rw-r--r--tests/framework/Macros.h7
-rw-r--r--tests/framework/TestCase.h1
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. */