diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2017-10-23 20:29:30 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:35:24 +0000 |
commit | 81a26ad6b626ce2da83659d7c6c17b6104d1f203 (patch) | |
tree | 536807115771f1a4b06048892d1d4e17c98779de /tests/benchmark | |
parent | 511347a7282b948bddfc071e9a8fa08e79da25b4 (diff) | |
download | ComputeLibrary-81a26ad6b626ce2da83659d7c6c17b6104d1f203.tar.gz |
COMPMID-643: Add bias to CLDepthwiseConvolution.
Change-Id: Ibfe7b8c1172d10cbcae7971fe86b82090519d31d
Reviewed-on: http://mpd-gerrit.cambridge.arm.com/92798
Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Reviewed-by: Jaroslaw Rzepecki <jaroslaw.rzepecki@arm.com>
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'tests/benchmark')
-rw-r--r-- | tests/benchmark/fixtures/DepthwiseConvolutionFixture.h | 8 | ||||
-rw-r--r-- | tests/benchmark/fixtures/DepthwiseSeparableConvolutionLayerFixture.h | 22 |
2 files changed, 20 insertions, 10 deletions
diff --git a/tests/benchmark/fixtures/DepthwiseConvolutionFixture.h b/tests/benchmark/fixtures/DepthwiseConvolutionFixture.h index e080fe253b..0095509cf7 100644 --- a/tests/benchmark/fixtures/DepthwiseConvolutionFixture.h +++ b/tests/benchmark/fixtures/DepthwiseConvolutionFixture.h @@ -40,7 +40,7 @@ class DepthwiseConvolutionFixture : public framework::Fixture { public: template <typename...> - void setup(TensorShape src_shape, TensorShape weights_shape, TensorShape dst_shape, PadStrideInfo info, DataType data_type, int batches) + void setup(TensorShape src_shape, TensorShape weights_shape, TensorShape biases_shape, TensorShape dst_shape, PadStrideInfo info, DataType data_type, int batches) { // Set batched in source and destination shapes const unsigned int fixed_point_position = 4; @@ -50,14 +50,16 @@ public: // Create tensors src = create_tensor<TensorType>(src_shape, data_type, 1, fixed_point_position); weights = create_tensor<TensorType>(weights_shape, data_type, 1, fixed_point_position); + biases = create_tensor<TensorType>(biases_shape, data_type, 1, fixed_point_position); dst = create_tensor<TensorType>(dst_shape, data_type, 1, fixed_point_position); // Create and configure function - depth_conv.configure(&src, &dst, &weights, info); + depth_conv.configure(&src, &dst, &weights, &biases, info); // Allocate tensors src.allocator()->allocate(); weights.allocator()->allocate(); + biases.allocator()->allocate(); dst.allocator()->allocate(); // Fill tensors @@ -74,12 +76,14 @@ public: { src.allocator()->free(); weights.allocator()->free(); + biases.allocator()->free(); dst.allocator()->free(); } private: TensorType src{}; TensorType weights{}; + TensorType biases{}; TensorType dst{}; Function depth_conv{}; }; diff --git a/tests/benchmark/fixtures/DepthwiseSeparableConvolutionLayerFixture.h b/tests/benchmark/fixtures/DepthwiseSeparableConvolutionLayerFixture.h index 928b0c7328..fa1544042f 100644 --- a/tests/benchmark/fixtures/DepthwiseSeparableConvolutionLayerFixture.h +++ b/tests/benchmark/fixtures/DepthwiseSeparableConvolutionLayerFixture.h @@ -40,7 +40,8 @@ class DepthwiseSeparableConvolutionLayerFixture : public framework::Fixture { public: template <typename...> - void setup(TensorShape src_shape, TensorShape depthwise_weights_shape, TensorShape depthwise_out_shape, TensorShape pointwise_weights_shape, TensorShape biases_shape, TensorShape dst_shape, + void setup(TensorShape src_shape, TensorShape depthwise_weights_shape, TensorShape depthwise_biases_shape, TensorShape depthwise_out_shape, TensorShape pointwise_weights_shape, + TensorShape pointwise_biases_shape, TensorShape dst_shape, PadStrideInfo pad_stride_depthwise_info, PadStrideInfo pad_stride_pointwise_info, DataType data_type, int batches) { // Set batched in source and destination shapes @@ -51,27 +52,30 @@ public: src = create_tensor<TensorType>(src_shape, data_type, 1, fixed_point_position); depthwise_weights = create_tensor<TensorType>(depthwise_weights_shape, data_type, 1, fixed_point_position); + depthwise_biases = create_tensor<TensorType>(depthwise_biases_shape, data_type, 1, fixed_point_position); depthwise_out = create_tensor<TensorType>(depthwise_out_shape, data_type, 1, fixed_point_position); pointwise_weights = create_tensor<TensorType>(pointwise_weights_shape, data_type, 1, fixed_point_position); - biases = create_tensor<TensorType>(biases_shape, data_type, 1, fixed_point_position); + pointwise_biases = create_tensor<TensorType>(pointwise_biases_shape, data_type, 1, fixed_point_position); dst = create_tensor<TensorType>(dst_shape, data_type, 1, fixed_point_position); // Create and configure function - depth_sep_conv_layer.configure(&src, &depthwise_weights, &depthwise_out, &pointwise_weights, &biases, &dst, pad_stride_depthwise_info, pad_stride_pointwise_info); + depth_sep_conv_layer.configure(&src, &depthwise_weights, &depthwise_biases, &depthwise_out, &pointwise_weights, &pointwise_biases, &dst, pad_stride_depthwise_info, pad_stride_pointwise_info); // Allocate tensors src.allocator()->allocate(); depthwise_weights.allocator()->allocate(); + depthwise_biases.allocator()->allocate(); depthwise_out.allocator()->allocate(); pointwise_weights.allocator()->allocate(); - biases.allocator()->allocate(); + pointwise_biases.allocator()->allocate(); dst.allocator()->allocate(); // Fill tensors library->fill_tensor_uniform(Accessor(src), 0); library->fill_tensor_uniform(Accessor(depthwise_weights), 1); - library->fill_tensor_uniform(Accessor(pointwise_weights), 2); - library->fill_tensor_uniform(Accessor(biases), 3); + library->fill_tensor_uniform(Accessor(depthwise_biases), 2); + library->fill_tensor_uniform(Accessor(pointwise_weights), 3); + library->fill_tensor_uniform(Accessor(pointwise_biases), 4); } void run() @@ -83,18 +87,20 @@ public: { src.allocator()->free(); depthwise_weights.allocator()->free(); + depthwise_biases.allocator()->free(); depthwise_out.allocator()->free(); pointwise_weights.allocator()->free(); - biases.allocator()->free(); + pointwise_biases.allocator()->free(); dst.allocator()->free(); } private: TensorType src{}; TensorType depthwise_weights{}; + TensorType depthwise_biases{}; TensorType depthwise_out{}; TensorType pointwise_weights{}; - TensorType biases{}; + TensorType pointwise_biases{}; TensorType dst{}; Function depth_sep_conv_layer{}; }; |