aboutsummaryrefslogtreecommitdiff
path: root/tests/benchmark
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/benchmark
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/benchmark')
-rw-r--r--tests/benchmark/fixtures/ActivationLayerFixture.h6
-rw-r--r--tests/benchmark/fixtures/AlexNetFixture.h5
-rw-r--r--tests/benchmark/fixtures/BatchNormalizationLayerFixture.h18
-rw-r--r--tests/benchmark/fixtures/ConvolutionLayerFixture.h19
-rw-r--r--tests/benchmark/fixtures/DepthConcatenateLayerFixture.h6
-rw-r--r--tests/benchmark/fixtures/DepthwiseConvolutionLayerFixture.h6
-rw-r--r--tests/benchmark/fixtures/DepthwiseSeparableConvolutionLayerFixture.h6
-rw-r--r--tests/benchmark/fixtures/DequantizationLayerFixture.h6
-rw-r--r--tests/benchmark/fixtures/FlattenLayerFixture.h6
-rw-r--r--tests/benchmark/fixtures/FloorFixture.h6
-rw-r--r--tests/benchmark/fixtures/FullyConnectedLayerFixture.h19
-rw-r--r--tests/benchmark/fixtures/GEMMFixture.h6
-rw-r--r--tests/benchmark/fixtures/GEMMInterleave4x4Fixture.h6
-rw-r--r--tests/benchmark/fixtures/GEMMLowpFixture.h6
-rw-r--r--tests/benchmark/fixtures/L2NormalizeLayerFixture.h6
-rw-r--r--tests/benchmark/fixtures/LeNet5Fixture.h5
-rw-r--r--tests/benchmark/fixtures/MobileNetFixture.h5
-rw-r--r--tests/benchmark/fixtures/MobileNetV1Fixture.h5
-rw-r--r--tests/benchmark/fixtures/NormalizationLayerFixture.h6
-rw-r--r--tests/benchmark/fixtures/NormalizePlanarYUVLayerFixture.h18
-rw-r--r--tests/benchmark/fixtures/PoolingLayerFixture.h6
-rw-r--r--tests/benchmark/fixtures/QuantizationLayerFixture.h6
-rw-r--r--tests/benchmark/fixtures/ROIPoolingLayerFixture.h6
-rw-r--r--tests/benchmark/fixtures/ReshapeLayerFixture.h6
-rw-r--r--tests/benchmark/fixtures/ScaleFixture.h6
-rw-r--r--tests/benchmark/fixtures/ScaleLayerFixture.h19
-rw-r--r--tests/benchmark/fixtures/SoftmaxLayerFixture.h19
-rw-r--r--tests/benchmark/fixtures/TransposeFixture.h6
28 files changed, 164 insertions, 76 deletions
diff --git a/tests/benchmark/fixtures/ActivationLayerFixture.h b/tests/benchmark/fixtures/ActivationLayerFixture.h
index 9ded063a37..11fabf8765 100644
--- a/tests/benchmark/fixtures/ActivationLayerFixture.h
+++ b/tests/benchmark/fixtures/ActivationLayerFixture.h
@@ -66,6 +66,12 @@ public:
act_layer.run();
}
+ void sync()
+ {
+ sync_if_necessary<TensorType>();
+ sync_tensor_if_necessary<TensorType>(dst);
+ }
+
void teardown()
{
src.allocator()->free();
diff --git a/tests/benchmark/fixtures/AlexNetFixture.h b/tests/benchmark/fixtures/AlexNetFixture.h
index 961f4e889f..a543ba2af2 100644
--- a/tests/benchmark/fixtures/AlexNetFixture.h
+++ b/tests/benchmark/fixtures/AlexNetFixture.h
@@ -65,6 +65,11 @@ public:
network.run();
}
+ void sync()
+ {
+ network.sync();
+ }
+
void teardown()
{
network.clear();
diff --git a/tests/benchmark/fixtures/BatchNormalizationLayerFixture.h b/tests/benchmark/fixtures/BatchNormalizationLayerFixture.h
index 55411a44d1..5f32e77e55 100644
--- a/tests/benchmark/fixtures/BatchNormalizationLayerFixture.h
+++ b/tests/benchmark/fixtures/BatchNormalizationLayerFixture.h
@@ -29,12 +29,6 @@
#include "tests/Globals.h"
#include "tests/Utils.h"
#include "tests/framework/Fixture.h"
-#ifdef ARM_COMPUTE_GC
-#include "arm_compute/runtime/GLES_COMPUTE/GCScheduler.h"
-#include "tests/GLES_COMPUTE/Helper.h"
-
-using namespace arm_compute::test::gles_compute;
-#endif /* ARM_COMPUTE_GC */
namespace arm_compute
{
@@ -82,12 +76,12 @@ public:
void run()
{
batch_norm_layer.run();
-#ifdef ARM_COMPUTE_GC
- if(opengles31_is_available() && std::is_same<typename std::decay<TensorType>::type, arm_compute::GCTensor>::value)
- {
- force_sync_tensor(dst);
- }
-#endif /* ARM_COMPUTE_GC */
+ }
+
+ void sync()
+ {
+ sync_if_necessary<TensorType>();
+ sync_tensor_if_necessary<TensorType>(dst);
}
void teardown()
diff --git a/tests/benchmark/fixtures/ConvolutionLayerFixture.h b/tests/benchmark/fixtures/ConvolutionLayerFixture.h
index b526cc3870..403160782d 100644
--- a/tests/benchmark/fixtures/ConvolutionLayerFixture.h
+++ b/tests/benchmark/fixtures/ConvolutionLayerFixture.h
@@ -30,13 +30,6 @@
#include "tests/Utils.h"
#include "tests/framework/Fixture.h"
-#ifdef ARM_COMPUTE_GC
-#include "arm_compute/runtime/GLES_COMPUTE/GCScheduler.h"
-#include "tests/GLES_COMPUTE/Helper.h"
-
-using namespace arm_compute::test::gles_compute;
-#endif /* ARM_COMPUTE_GC */
-
namespace arm_compute
{
namespace test
@@ -78,12 +71,12 @@ public:
void run()
{
conv_layer.run();
-#ifdef ARM_COMPUTE_GC
- if(opengles31_is_available() && std::is_same<typename std::decay<TensorType>::type, arm_compute::GCTensor>::value)
- {
- force_sync_tensor(dst);
- }
-#endif /* ARM_COMPUTE_GC */
+ }
+
+ void sync()
+ {
+ sync_if_necessary<TensorType>();
+ sync_tensor_if_necessary<TensorType>(dst);
}
void teardown()
diff --git a/tests/benchmark/fixtures/DepthConcatenateLayerFixture.h b/tests/benchmark/fixtures/DepthConcatenateLayerFixture.h
index 221f34c6fd..523a41b8be 100644
--- a/tests/benchmark/fixtures/DepthConcatenateLayerFixture.h
+++ b/tests/benchmark/fixtures/DepthConcatenateLayerFixture.h
@@ -123,6 +123,12 @@ public:
_depth_concat.run();
}
+ void sync()
+ {
+ sync_if_necessary<TensorType>();
+ sync_tensor_if_necessary<TensorType>(_dst);
+ }
+
void teardown()
{
for(auto &src : _srcs)
diff --git a/tests/benchmark/fixtures/DepthwiseConvolutionLayerFixture.h b/tests/benchmark/fixtures/DepthwiseConvolutionLayerFixture.h
index 19ebb4e3dd..d505ba3006 100644
--- a/tests/benchmark/fixtures/DepthwiseConvolutionLayerFixture.h
+++ b/tests/benchmark/fixtures/DepthwiseConvolutionLayerFixture.h
@@ -72,6 +72,12 @@ public:
depth_conv.run();
}
+ void sync()
+ {
+ sync_if_necessary<TensorType>();
+ sync_tensor_if_necessary<TensorType>(dst);
+ }
+
void teardown()
{
src.allocator()->free();
diff --git a/tests/benchmark/fixtures/DepthwiseSeparableConvolutionLayerFixture.h b/tests/benchmark/fixtures/DepthwiseSeparableConvolutionLayerFixture.h
index fa1544042f..c841996c6c 100644
--- a/tests/benchmark/fixtures/DepthwiseSeparableConvolutionLayerFixture.h
+++ b/tests/benchmark/fixtures/DepthwiseSeparableConvolutionLayerFixture.h
@@ -83,6 +83,12 @@ public:
depth_sep_conv_layer.run();
}
+ void sync()
+ {
+ sync_if_necessary<TensorType>();
+ sync_tensor_if_necessary<TensorType>(dst);
+ }
+
void teardown()
{
src.allocator()->free();
diff --git a/tests/benchmark/fixtures/DequantizationLayerFixture.h b/tests/benchmark/fixtures/DequantizationLayerFixture.h
index 30e05f9c3b..4251a96881 100644
--- a/tests/benchmark/fixtures/DequantizationLayerFixture.h
+++ b/tests/benchmark/fixtures/DequantizationLayerFixture.h
@@ -73,6 +73,12 @@ public:
dequantization_func.run();
}
+ void sync()
+ {
+ sync_if_necessary<TensorType>();
+ sync_tensor_if_necessary<TensorType>(dst);
+ }
+
void teardown()
{
src.allocator()->free();
diff --git a/tests/benchmark/fixtures/FlattenLayerFixture.h b/tests/benchmark/fixtures/FlattenLayerFixture.h
index 67f5f01781..f6e44a2101 100644
--- a/tests/benchmark/fixtures/FlattenLayerFixture.h
+++ b/tests/benchmark/fixtures/FlattenLayerFixture.h
@@ -68,6 +68,12 @@ public:
flatten_func.run();
}
+ void sync()
+ {
+ sync_if_necessary<TensorType>();
+ sync_tensor_if_necessary<TensorType>(dst);
+ }
+
void teardown()
{
src.allocator()->free();
diff --git a/tests/benchmark/fixtures/FloorFixture.h b/tests/benchmark/fixtures/FloorFixture.h
index 8de87b886b..b6bb89642d 100644
--- a/tests/benchmark/fixtures/FloorFixture.h
+++ b/tests/benchmark/fixtures/FloorFixture.h
@@ -62,6 +62,12 @@ public:
floor_func.run();
}
+ void sync()
+ {
+ sync_if_necessary<TensorType>();
+ sync_tensor_if_necessary<TensorType>(dst);
+ }
+
void teardown()
{
src.allocator()->free();
diff --git a/tests/benchmark/fixtures/FullyConnectedLayerFixture.h b/tests/benchmark/fixtures/FullyConnectedLayerFixture.h
index ef08c4ad8b..08c2ef9104 100644
--- a/tests/benchmark/fixtures/FullyConnectedLayerFixture.h
+++ b/tests/benchmark/fixtures/FullyConnectedLayerFixture.h
@@ -30,13 +30,6 @@
#include "tests/Utils.h"
#include "tests/framework/Fixture.h"
-#ifdef ARM_COMPUTE_GC
-#include "arm_compute/runtime/GLES_COMPUTE/GCScheduler.h"
-#include "tests/GLES_COMPUTE/Helper.h"
-
-using namespace arm_compute::test::gles_compute;
-#endif /* ARM_COMPUTE_GC */
-
namespace arm_compute
{
namespace test
@@ -78,12 +71,12 @@ public:
void run()
{
fc_layer.run();
-#ifdef ARM_COMPUTE_GC
- if(opengles31_is_available() && std::is_same<typename std::decay<TensorType>::type, arm_compute::GCTensor>::value)
- {
- force_sync_tensor(dst);
- }
-#endif /* ARM_COMPUTE_GC */
+ }
+
+ void sync()
+ {
+ sync_if_necessary<TensorType>();
+ sync_tensor_if_necessary<TensorType>(dst);
}
void teardown()
diff --git a/tests/benchmark/fixtures/GEMMFixture.h b/tests/benchmark/fixtures/GEMMFixture.h
index 0c41c67af1..d1eded074c 100644
--- a/tests/benchmark/fixtures/GEMMFixture.h
+++ b/tests/benchmark/fixtures/GEMMFixture.h
@@ -69,6 +69,12 @@ public:
gemm.run();
}
+ void sync()
+ {
+ sync_if_necessary<TensorType>();
+ sync_tensor_if_necessary<TensorType>(dst);
+ }
+
void teardown()
{
a.allocator()->free();
diff --git a/tests/benchmark/fixtures/GEMMInterleave4x4Fixture.h b/tests/benchmark/fixtures/GEMMInterleave4x4Fixture.h
index e55e092240..293ceff5d1 100644
--- a/tests/benchmark/fixtures/GEMMInterleave4x4Fixture.h
+++ b/tests/benchmark/fixtures/GEMMInterleave4x4Fixture.h
@@ -69,6 +69,12 @@ public:
gemm.run();
}
+ void sync()
+ {
+ sync_if_necessary<TensorType>();
+ sync_tensor_if_necessary<TensorType>(b);
+ }
+
void teardown()
{
a.allocator()->free();
diff --git a/tests/benchmark/fixtures/GEMMLowpFixture.h b/tests/benchmark/fixtures/GEMMLowpFixture.h
index 4bd7dfd42f..1b64591191 100644
--- a/tests/benchmark/fixtures/GEMMLowpFixture.h
+++ b/tests/benchmark/fixtures/GEMMLowpFixture.h
@@ -72,6 +72,12 @@ public:
gemmlowp.run();
}
+ void sync()
+ {
+ sync_if_necessary<TensorType>();
+ sync_tensor_if_necessary<TensorType>(c);
+ }
+
void teardown()
{
a.allocator()->free();
diff --git a/tests/benchmark/fixtures/L2NormalizeLayerFixture.h b/tests/benchmark/fixtures/L2NormalizeLayerFixture.h
index 296a2e9fac..ae5b1a1cd3 100644
--- a/tests/benchmark/fixtures/L2NormalizeLayerFixture.h
+++ b/tests/benchmark/fixtures/L2NormalizeLayerFixture.h
@@ -64,6 +64,12 @@ public:
l2norm_func.run();
}
+ void sync()
+ {
+ sync_if_necessary<TensorType>();
+ sync_tensor_if_necessary<TensorType>(dst);
+ }
+
void teardown()
{
src.allocator()->free();
diff --git a/tests/benchmark/fixtures/LeNet5Fixture.h b/tests/benchmark/fixtures/LeNet5Fixture.h
index 77a09d3025..191daa2aff 100644
--- a/tests/benchmark/fixtures/LeNet5Fixture.h
+++ b/tests/benchmark/fixtures/LeNet5Fixture.h
@@ -57,6 +57,11 @@ public:
network.run();
}
+ void sync()
+ {
+ network.sync();
+ }
+
void teardown()
{
network.clear();
diff --git a/tests/benchmark/fixtures/MobileNetFixture.h b/tests/benchmark/fixtures/MobileNetFixture.h
index 660205c7ec..165b269b59 100644
--- a/tests/benchmark/fixtures/MobileNetFixture.h
+++ b/tests/benchmark/fixtures/MobileNetFixture.h
@@ -58,6 +58,11 @@ public:
network.run();
}
+ void sync()
+ {
+ network.sync();
+ }
+
void teardown()
{
network.clear();
diff --git a/tests/benchmark/fixtures/MobileNetV1Fixture.h b/tests/benchmark/fixtures/MobileNetV1Fixture.h
index 07333dde0e..54b0d09a32 100644
--- a/tests/benchmark/fixtures/MobileNetV1Fixture.h
+++ b/tests/benchmark/fixtures/MobileNetV1Fixture.h
@@ -61,6 +61,11 @@ public:
network.run();
}
+ void sync()
+ {
+ network.sync();
+ }
+
void teardown()
{
network.clear();
diff --git a/tests/benchmark/fixtures/NormalizationLayerFixture.h b/tests/benchmark/fixtures/NormalizationLayerFixture.h
index 41dd8a7b27..cbe20d59da 100644
--- a/tests/benchmark/fixtures/NormalizationLayerFixture.h
+++ b/tests/benchmark/fixtures/NormalizationLayerFixture.h
@@ -66,6 +66,12 @@ public:
norm_layer.run();
}
+ void sync()
+ {
+ sync_if_necessary<TensorType>();
+ sync_tensor_if_necessary<TensorType>(dst);
+ }
+
void teardown()
{
src.allocator()->free();
diff --git a/tests/benchmark/fixtures/NormalizePlanarYUVLayerFixture.h b/tests/benchmark/fixtures/NormalizePlanarYUVLayerFixture.h
index 92343534dc..a84aa26023 100644
--- a/tests/benchmark/fixtures/NormalizePlanarYUVLayerFixture.h
+++ b/tests/benchmark/fixtures/NormalizePlanarYUVLayerFixture.h
@@ -29,12 +29,6 @@
#include "tests/Globals.h"
#include "tests/Utils.h"
#include "tests/framework/Fixture.h"
-#ifdef ARM_COMPUTE_GC
-#include "arm_compute/runtime/GLES_COMPUTE/GCScheduler.h"
-#include "tests/GLES_COMPUTE/Helper.h"
-
-using namespace arm_compute::test::gles_compute;
-#endif /* ARM_COMPUTE_GC */
namespace arm_compute
{
@@ -75,12 +69,12 @@ public:
void run()
{
normalize_planar_yuv_layer.run();
-#ifdef ARM_COMPUTE_GC
- if(opengles31_is_available() && std::is_same<typename std::decay<TensorType>::type, arm_compute::GCTensor>::value)
- {
- force_sync_tensor(dst);
- }
-#endif /* ARM_COMPUTE_GC */
+ }
+
+ void sync()
+ {
+ sync_if_necessary<TensorType>();
+ sync_tensor_if_necessary<TensorType>(dst);
}
void teardown()
diff --git a/tests/benchmark/fixtures/PoolingLayerFixture.h b/tests/benchmark/fixtures/PoolingLayerFixture.h
index 2060301531..47deda93ec 100644
--- a/tests/benchmark/fixtures/PoolingLayerFixture.h
+++ b/tests/benchmark/fixtures/PoolingLayerFixture.h
@@ -67,6 +67,12 @@ public:
pool_layer.run();
}
+ void sync()
+ {
+ sync_if_necessary<TensorType>();
+ sync_tensor_if_necessary<TensorType>(dst);
+ }
+
void teardown()
{
src.allocator()->free();
diff --git a/tests/benchmark/fixtures/QuantizationLayerFixture.h b/tests/benchmark/fixtures/QuantizationLayerFixture.h
index 5981f9995c..0843962edf 100644
--- a/tests/benchmark/fixtures/QuantizationLayerFixture.h
+++ b/tests/benchmark/fixtures/QuantizationLayerFixture.h
@@ -63,6 +63,12 @@ public:
quantization_func.run();
}
+ void sync()
+ {
+ sync_if_necessary<TensorType>();
+ sync_tensor_if_necessary<TensorType>(dst);
+ }
+
void teardown()
{
src.allocator()->free();
diff --git a/tests/benchmark/fixtures/ROIPoolingLayerFixture.h b/tests/benchmark/fixtures/ROIPoolingLayerFixture.h
index 76c2280b74..9013218712 100644
--- a/tests/benchmark/fixtures/ROIPoolingLayerFixture.h
+++ b/tests/benchmark/fixtures/ROIPoolingLayerFixture.h
@@ -78,6 +78,12 @@ public:
roi_pool.run();
}
+ void sync()
+ {
+ sync_if_necessary<TensorType>();
+ sync_tensor_if_necessary<TensorType>(dst);
+ }
+
void teardown()
{
src.allocator()->free();
diff --git a/tests/benchmark/fixtures/ReshapeLayerFixture.h b/tests/benchmark/fixtures/ReshapeLayerFixture.h
index 4f65e9d6c5..b92377c58c 100644
--- a/tests/benchmark/fixtures/ReshapeLayerFixture.h
+++ b/tests/benchmark/fixtures/ReshapeLayerFixture.h
@@ -64,6 +64,12 @@ public:
reshape_func.run();
}
+ void sync()
+ {
+ sync_if_necessary<TensorType>();
+ sync_tensor_if_necessary<TensorType>(dst);
+ }
+
void teardown()
{
src.allocator()->free();
diff --git a/tests/benchmark/fixtures/ScaleFixture.h b/tests/benchmark/fixtures/ScaleFixture.h
index 1ba191be5a..21a6391953 100644
--- a/tests/benchmark/fixtures/ScaleFixture.h
+++ b/tests/benchmark/fixtures/ScaleFixture.h
@@ -81,6 +81,12 @@ public:
scale_func.run();
}
+ void sync()
+ {
+ sync_if_necessary<TensorType>();
+ sync_tensor_if_necessary<TensorType>(dst);
+ }
+
void teardown()
{
src.allocator()->free();
diff --git a/tests/benchmark/fixtures/ScaleLayerFixture.h b/tests/benchmark/fixtures/ScaleLayerFixture.h
index 94cc678b7f..f34a0033c1 100644
--- a/tests/benchmark/fixtures/ScaleLayerFixture.h
+++ b/tests/benchmark/fixtures/ScaleLayerFixture.h
@@ -31,13 +31,6 @@
#include "tests/framework/Asserts.h"
#include "tests/framework/Fixture.h"
-#ifdef ARM_COMPUTE_GC
-#include "arm_compute/runtime/GLES_COMPUTE/GCScheduler.h"
-#include "tests/GLES_COMPUTE/Helper.h"
-
-using namespace arm_compute::test::gles_compute;
-#endif /* ARM_COMPUTE_GC */
-
namespace arm_compute
{
namespace test
@@ -83,12 +76,12 @@ public:
void run()
{
scale_layer.run();
-#ifdef ARM_COMPUTE_GC
- if(opengles31_is_available() && std::is_same<typename std::decay<TensorType>::type, arm_compute::GCTensor>::value)
- {
- force_sync_tensor(dst);
- }
-#endif /* ARM_COMPUTE_GC */
+ }
+
+ void sync()
+ {
+ sync_if_necessary<TensorType>();
+ sync_tensor_if_necessary<TensorType>(dst);
}
void teardown()
diff --git a/tests/benchmark/fixtures/SoftmaxLayerFixture.h b/tests/benchmark/fixtures/SoftmaxLayerFixture.h
index 50b272621e..f3657daf75 100644
--- a/tests/benchmark/fixtures/SoftmaxLayerFixture.h
+++ b/tests/benchmark/fixtures/SoftmaxLayerFixture.h
@@ -31,13 +31,6 @@
#include "tests/framework/Asserts.h"
#include "tests/framework/Fixture.h"
-#ifdef ARM_COMPUTE_GC
-#include "arm_compute/runtime/GLES_COMPUTE/GCScheduler.h"
-#include "tests/GLES_COMPUTE/Helper.h"
-
-using namespace arm_compute::test::gles_compute;
-#endif /* ARM_COMPUTE_GC */
-
namespace arm_compute
{
namespace test
@@ -73,12 +66,12 @@ public:
void run()
{
smx_layer.run();
-#ifdef ARM_COMPUTE_GC
- if(opengles31_is_available() && std::is_same<typename std::decay<TensorType>::type, arm_compute::GCTensor>::value)
- {
- force_sync_tensor(dst);
- }
-#endif /* ARM_COMPUTE_GC */
+ }
+
+ void sync()
+ {
+ sync_if_necessary<TensorType>();
+ sync_tensor_if_necessary<TensorType>(dst);
}
void teardown()
diff --git a/tests/benchmark/fixtures/TransposeFixture.h b/tests/benchmark/fixtures/TransposeFixture.h
index 19d2194f63..bc2d6d613e 100644
--- a/tests/benchmark/fixtures/TransposeFixture.h
+++ b/tests/benchmark/fixtures/TransposeFixture.h
@@ -67,6 +67,12 @@ public:
transpose.run();
}
+ void sync()
+ {
+ sync_if_necessary<TensorType>();
+ sync_tensor_if_necessary<TensorType>(dst);
+ }
+
void teardown()
{
src.allocator()->free();