From 82e628b833d199d1e198d640bef08fd516e3f422 Mon Sep 17 00:00:00 2001 From: Edward Smyth Date: Mon, 29 Apr 2024 04:49:42 -0400 Subject: [PATCH] GTestSuite: seg faults in data generator Following a recent change to the data generators to allow a stride to be specified (60cc23f3d3479f98ac83fde676756eb6c9e61e11), seg faults can occur if m<=0 for column storage or n<=0 for row storage. Prevent this by having separarate code paths to handle these scenarios. AMD-Internal: [CPUPL-4500] Change-Id: I23ed8b2dccaaca140e2ddfda45bcdb4c888d5708 --- .../inc/common/data_generators.h | 188 +++++++++++------- 1 file changed, 120 insertions(+), 68 deletions(-) diff --git a/gtestsuite/testinghelpers/inc/common/data_generators.h b/gtestsuite/testinghelpers/inc/common/data_generators.h index 0b0c0bed1..0c50bc831 100644 --- a/gtestsuite/testinghelpers/inc/common/data_generators.h +++ b/gtestsuite/testinghelpers/inc/common/data_generators.h @@ -128,65 +128,91 @@ void getfp(T2 from, T3 to, char storage, gtint_t m, gtint_t n, T1* a, gtint_t ld if((storage == 'c') || (storage == 'C')) { - for(gtint_t j=0; j 0) { - if constexpr (testinghelpers::type_info::is_real) + for(gtint_t j=0; j::is_real) { - for(gtint_t p=1; p 0) { - if constexpr (testinghelpers::type_info::is_real) + for(gtint_t i=0; i::is_real) { - for(gtint_t p=1; p 0) { - if constexpr (testinghelpers::type_info::is_real) + for(gtint_t j=0; j::is_real) { - for(gtint_t p=1; p 0) { - if constexpr (testinghelpers::type_info::is_real) + for(gtint_t i=0; i::is_real) { - for(gtint_t p=1; p