From 31038551755f25164c0dd042c867c449d65c9d8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Fl=C3=B6jt?= Date: Thu, 5 Mar 2026 14:31:18 +0100 Subject: [PATCH] fix: GPU only debug build errors in test fixtures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows building with a debug=1 opencl=1 neon=0 config. Partially-resolves: COMPMID-8697 Signed-off-by: Andreas Flöjt Change-Id: I3c9df22828d58257d9df5ff1badf554d066bde69 --- .../validation/fixtures/ConvolutionLayerFixture.h | 12 ++++++++++++ tests/validation/fixtures/GEMMLowpFixture.h | 14 +++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/tests/validation/fixtures/ConvolutionLayerFixture.h b/tests/validation/fixtures/ConvolutionLayerFixture.h index 9dac137dcc..67f7d1337b 100644 --- a/tests/validation/fixtures/ConvolutionLayerFixture.h +++ b/tests/validation/fixtures/ConvolutionLayerFixture.h @@ -198,6 +198,11 @@ class ConvolutionValidationGenericFixture : public framework::Fixture bool padded_weights = false, bool updated_sq_info_after_config = false) { +#ifndef ARM_COMPUTE_CPU_ENABLED + ARM_COMPUTE_UNUSED(updated_sq_info_after_config); + ARM_COMPUTE_ERROR_ON(updated_sq_info_after_config); +#endif // ARM_COMPUTE_CPU_ENABLED + if (std::is_same::value && // Cpu (data_type == DataType::F16 || weights_data_type == DataType::F16) && !CPUInfo::get().has_fp16()) { @@ -236,6 +241,7 @@ class ConvolutionValidationGenericFixture : public framework::Fixture _use_dynamic_output_quant = true; } +#ifdef ARM_COMPUTE_CPU_ENABLED if (updated_sq_info_after_config) { _target = compute_gemmlowp_target_for_updated_sq_info_after_config( @@ -243,6 +249,7 @@ class ConvolutionValidationGenericFixture : public framework::Fixture pre_pad_layer, padded_weights); } else +#endif // ARM_COMPUTE_CPU_ENABLED { _target = compute_target(input_shape, weights_shape, bias_shape, output_shape, info, reshape_weights, dilation, act_info, pre_pad_layer, padded_weights); @@ -484,6 +491,7 @@ class ConvolutionValidationGenericFixture : public framework::Fixture return dst; } +#ifdef ARM_COMPUTE_CPU_ENABLED // Compute the target when updating static quantization information after configuration. TensorType compute_gemmlowp_target_for_updated_sq_info_after_config(TensorShape input_shape, TensorShape weights_shape, @@ -496,6 +504,9 @@ class ConvolutionValidationGenericFixture : public framework::Fixture PaddingList pre_pad_layer = PaddingList({}), bool padded_weights = false) { + // Runtime assert rather than static_assert because this template gets + // instantiated with FunctionType other than NEGEMMConvolutionLayer. The + // function call itself is prevented at runtime with conditions. ARM_COMPUTE_ASSERT((std::is_same::value == true)); ARM_COMPUTE_ERROR_ON((input_shape[2] % weights_shape[2]) != 0); @@ -612,6 +623,7 @@ class ConvolutionValidationGenericFixture : public framework::Fixture } return dst; } +#endif // ARM_COMPUTE_CPU_ENABLED SimpleTensor compute_reference(const TensorShape &input_shape, const TensorShape &weights_shape, diff --git a/tests/validation/fixtures/GEMMLowpFixture.h b/tests/validation/fixtures/GEMMLowpFixture.h index 0a80252388..79671c58a4 100644 --- a/tests/validation/fixtures/GEMMLowpFixture.h +++ b/tests/validation/fixtures/GEMMLowpFixture.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2025 Arm Limited. + * Copyright (c) 2017-2026 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -105,6 +105,7 @@ struct TensorFillInfo int32_t hash{0}; }; +#ifdef ARM_COMPUTE_CPU_ENABLED template ::value == true)); ARM_COMPUTE_ASSERT(is_data_type_quantized_asymmetric(data_type_a)); ARM_COMPUTE_ASSERT(is_data_type_quantized_asymmetric(data_type_b)); @@ -222,6 +226,7 @@ TensorType compute_gemmlowp_target_for_updated_sq_info_after_config( gemmlowp.run(); return output; } +#endif // ARM_COMPUTE_CPU_ENABLED template (