aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSheri Zhang <sheri.zhang@arm.com>2021-09-15 13:10:18 +0100
committerSheri Zhang <sheri.zhang@arm.com>2021-09-15 18:54:26 +0000
commit9d6ddfc8a0ea579fb2a46fab971f6827d93fc96b (patch)
tree32c114be66e28f1cda38feb55fe66685c6e189bb
parente4563a032aaa71de5efdb83fc04ff2933338e02d (diff)
downloadComputeLibrary-9d6ddfc8a0ea579fb2a46fab971f6827d93fc96b.tar.gz
Fix nightly cl_image not supported issue
Resolves: COMPMID-4813 Signed-off-by: Sheri Zhang <sheri.zhang@arm.com> Change-Id: I773e5b1be2951431e072012fe393993411f68b66 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/6269 Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Gunes Bayir <gunes.bayir@arm.com> Reviewed-by: Giorgio Arena <giorgio.arena@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com>
-rw-r--r--tests/validation/fixtures/DepthwiseConvolutionLayerFixture.h41
1 files changed, 25 insertions, 16 deletions
diff --git a/tests/validation/fixtures/DepthwiseConvolutionLayerFixture.h b/tests/validation/fixtures/DepthwiseConvolutionLayerFixture.h
index ddbab7fe13..cecccc87bb 100644
--- a/tests/validation/fixtures/DepthwiseConvolutionLayerFixture.h
+++ b/tests/validation/fixtures/DepthwiseConvolutionLayerFixture.h
@@ -446,6 +446,19 @@ public:
void configure_target()
{
+#if defined(ARM_COMPUTE_OPENCL_ENABLED)
+ if(_export_to_cl_image)
+ {
+ _validate_output &= image2d_from_buffer_supported(CLKernelLibrary::get().get_device());
+ _validate_output &= (get_cl_image_pitch_alignment(CLKernelLibrary::get().get_device()) != 0);
+ }
+#endif // ARM_COMPUTE_OPENCL_ENABLED
+
+ if(!_validate_output)
+ {
+ return;
+ }
+
TensorShape input_shape = _input_shape;
TensorShape weights_shape = _weights_shape;
@@ -471,14 +484,6 @@ public:
dwc_info.m0 = _conv_info.stride().first == 1 && _dilation.x() == 1 ? 8 : 1;
dwc_info.export_weights_to_cl_image = _export_to_cl_image;
-#if defined(ARM_COMPUTE_OPENCL_ENABLED)
- if(_export_to_cl_image)
- {
- _validate_output |= image2d_from_buffer_supported(CLKernelLibrary::get().get_device());
- _validate_output |= (get_cl_image_pitch_alignment(CLKernelLibrary::get().get_device()) != 0);
- }
-#endif // ARM_COMPUTE_OPENCL_ENABLED
-
const ConvolutionInfo conv_kernel_info
{
_conv_info, _depth_multiplier, _act_info, _dilation
@@ -498,6 +503,11 @@ public:
void allocate_and_run_target()
{
+ if(!_validate_output)
+ {
+ return;
+ }
+
// Allocate tensors
_src.allocator()->allocate();
_weights.allocator()->allocate();
@@ -525,10 +535,7 @@ public:
}
// Compute function
- if(_validate_output)
- {
- _dwc.run();
- }
+ _dwc.run();
// Reinstating original data layout for the test suite to properly check the values
if(!_in_place)
@@ -539,6 +546,11 @@ public:
void compute_reference()
{
+ if(!_validate_output)
+ {
+ return;
+ }
+
SimpleTensor<T> src{ _input_shape, _data_type };
SimpleTensor<T> weights{ _weights_shape, _data_type };
SimpleTensor<T> biases{ _biases_shape, _data_type };
@@ -549,10 +561,7 @@ public:
const ConvolutionInfo info{ _conv_info, _depth_multiplier, _act_info, _dilation };
const TensorShape dst_shape = compute_depthwise_convolution_shape(TensorInfo(_input_shape, 1, _data_type), TensorInfo(_weights_shape, 1, _data_type), info);
- if(_validate_output)
- {
- _reference = reference::activation_layer(reference::depthwise_convolution(src, weights, biases, dst_shape, _conv_info, _depth_multiplier, _dilation), _act_info);
- }
+ _reference = reference::activation_layer(reference::depthwise_convolution(src, weights, biases, dst_shape, _conv_info, _depth_multiplier, _dilation), _act_info);
}
protected: