Skip to content

Commit 2c052d6

Browse files
committed
fix: Fix debug=1 opencl=1 neon=0 build
Partially-resolves: COMPMID-8697 Signed-off-by: Andreas Flöjt <andreas.floejt@arm.com> Change-Id: I3c9df22828d58257d9df5ff1badf554d066bde69
1 parent 408353a commit 2c052d6

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

tests/validation/fixtures/ConvolutionLayerFixture.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,11 @@ class ConvolutionValidationGenericFixture : public framework::Fixture
198198
bool padded_weights = false,
199199
bool updated_sq_info_after_config = false)
200200
{
201+
#ifndef ARM_COMPUTE_CPU_ENABLED
202+
ARM_COMPUTE_UNUSED(updated_sq_info_after_config);
203+
ARM_COMPUTE_ERROR_ON(updated_sq_info_after_config);
204+
#endif // ARM_COMPUTE_CPU_ENABLED
205+
201206
if (std::is_same<TensorType, Tensor>::value && // Cpu
202207
(data_type == DataType::F16 || weights_data_type == DataType::F16) && !CPUInfo::get().has_fp16())
203208
{
@@ -236,13 +241,15 @@ class ConvolutionValidationGenericFixture : public framework::Fixture
236241
_use_dynamic_output_quant = true;
237242
}
238243

244+
#ifdef ARM_COMPUTE_CPU_ENABLED
239245
if (updated_sq_info_after_config)
240246
{
241247
_target = compute_gemmlowp_target_for_updated_sq_info_after_config(
242248
input_shape, weights_shape, bias_shape, output_shape, info, reshape_weights, dilation, act_info,
243249
pre_pad_layer, padded_weights);
244250
}
245251
else
252+
#endif // ARM_COMPUTE_CPU_ENABLED
246253
{
247254
_target = compute_target(input_shape, weights_shape, bias_shape, output_shape, info, reshape_weights,
248255
dilation, act_info, pre_pad_layer, padded_weights);
@@ -484,6 +491,7 @@ class ConvolutionValidationGenericFixture : public framework::Fixture
484491
return dst;
485492
}
486493

494+
#ifdef ARM_COMPUTE_CPU_ENABLED
487495
// Compute the target when updating static quantization information after configuration.
488496
TensorType compute_gemmlowp_target_for_updated_sq_info_after_config(TensorShape input_shape,
489497
TensorShape weights_shape,
@@ -496,6 +504,9 @@ class ConvolutionValidationGenericFixture : public framework::Fixture
496504
PaddingList pre_pad_layer = PaddingList({}),
497505
bool padded_weights = false)
498506
{
507+
// Runtime assert rather than static_assert because this template gets
508+
// instantiated with FunctionType other than NEGEMMConvolutionLayer. The
509+
// function call itself is prevented at runtime with conditions.
499510
ARM_COMPUTE_ASSERT((std::is_same<FunctionType, NEGEMMConvolutionLayer>::value == true));
500511
ARM_COMPUTE_ERROR_ON((input_shape[2] % weights_shape[2]) != 0);
501512

@@ -612,6 +623,7 @@ class ConvolutionValidationGenericFixture : public framework::Fixture
612623
}
613624
return dst;
614625
}
626+
#endif // ARM_COMPUTE_CPU_ENABLED
615627

616628
SimpleTensor<TO> compute_reference(const TensorShape &input_shape,
617629
const TensorShape &weights_shape,

tests/validation/fixtures/GEMMLowpFixture.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017-2025 Arm Limited.
2+
* Copyright (c) 2017-2026 Arm Limited.
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -105,6 +105,7 @@ struct TensorFillInfo
105105
int32_t hash{0};
106106
};
107107

108+
#ifdef ARM_COMPUTE_CPU_ENABLED
108109
template <typename TensorType,
109110
typename AccessorType,
110111
typename FunctionType,
@@ -129,6 +130,9 @@ TensorType compute_gemmlowp_target_for_updated_sq_info_after_config(
129130
DataType data_type_output = DataType::UNKNOWN,
130131
const ActivationLayerInfo &act_info = ActivationLayerInfo())
131132
{
133+
// Runtime assert rather than static_assert because this template gets
134+
// instantiated with FunctionType other than NEGEMMLowpMatrixMultiplyCore. The
135+
// function call itself is prevented at runtime with conditions.
132136
ARM_COMPUTE_ASSERT((std::is_same<FunctionType, NEGEMMLowpMatrixMultiplyCore>::value == true));
133137
ARM_COMPUTE_ASSERT(is_data_type_quantized_asymmetric(data_type_a));
134138
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(
222226
gemmlowp.run();
223227
return output;
224228
}
229+
#endif // ARM_COMPUTE_CPU_ENABLED
225230

226231
template <typename TensorType,
227232
typename AccessorType,
@@ -730,6 +735,12 @@ class GEMMLowpGenericMatrixMultiplyCoreFusedOffsetOutputValidationFixture : publ
730735
bool updated_sq_info_after_config = false,
731736
const ActivationLayerInfo &act_info = ActivationLayerInfo())
732737
{
738+
#ifndef ARM_COMPUTE_CPU_ENABLED
739+
ARM_COMPUTE_UNUSED(updated_sq_info_after_config, act_info);
740+
ARM_COMPUTE_ERROR_ON(updated_sq_info_after_config);
741+
#endif // ARM_COMPUTE_CPU_ENABLED
742+
743+
#ifdef ARM_COMPUTE_CPU_ENABLED
733744
if (updated_sq_info_after_config)
734745
{
735746
return compute_gemmlowp_target_for_updated_sq_info_after_config<
@@ -739,6 +750,7 @@ class GEMMLowpGenericMatrixMultiplyCoreFusedOffsetOutputValidationFixture : publ
739750
arm_compute::DataType::UNKNOWN, act_info);
740751
}
741752
else
753+
#endif // ARM_COMPUTE_CPU_ENABLED
742754
{
743755
return compute_gemmlowp_target<TensorType, AccessorType, FunctionType, reinterpret_input_as_3d,
744756
reinterpret_output_as_3d, qasymm8_t, true, run_twice>(

0 commit comments

Comments
 (0)