From 97e7ce8e27cd854356b42bd7d05e8d92fa688354 Mon Sep 17 00:00:00 2001 From: Christophe Favergeon Date: Tue, 14 Apr 2020 14:47:21 +0200 Subject: [PATCH] CMSIS-DSP: Change to f16 code to be able to build with AC5 compiler. --- Include/arm_math.h | 41 +++++++++++++++++----- Platforms/FVP/ARMv81MML/system_ARMv81MML.c | 1 + Testing/CMakeLists.txt | 1 - Testing/FrameworkInclude/Error.h | 12 ++++++- Testing/FrameworkInclude/FPGA.h | 4 +++ Testing/FrameworkInclude/Pattern.h | 6 ++++ Testing/FrameworkInclude/Semihosting.h | 4 +++ Testing/FrameworkInclude/Test.h | 13 +++++-- Testing/FrameworkSource/Error.cpp | 12 +++++++ Testing/FrameworkSource/FPGA.cpp | 6 +++- Testing/FrameworkSource/Pattern.cpp | 6 ++++ Testing/FrameworkSource/PatternMgr.cpp | 6 ++++ Testing/FrameworkSource/Semihosting.cpp | 6 +++- Testing/TestScripts/Regression/Commands.py | 9 ----- 14 files changed, 103 insertions(+), 24 deletions(-) diff --git a/Include/arm_math.h b/Include/arm_math.h index fa9c9924..c98144e1 100644 --- a/Include/arm_math.h +++ b/Include/arm_math.h @@ -442,9 +442,11 @@ extern "C" /** * @brief 16-bit floating-point type definition. * This is already defined in arm_mve.h + * + * This is not fully supported on ARM AC5. */ -#if !defined (ARM_MATH_HELIUM) && !defined(ARM_MATH_MVEF) && !defined(ARM_MATH_MVEI) +#if !defined( __CC_ARM ) && !defined (ARM_MATH_HELIUM) && !defined(ARM_MATH_MVEF) && !defined(ARM_MATH_MVEI) typedef __fp16 float16_t; #endif @@ -778,28 +780,28 @@ extern "C" #define F64_MAX ((float64_t)DBL_MAX) #define F32_MAX ((float32_t)FLT_MAX) -#if defined(ARM_MATH_FLOAT16) +#if !defined( __CC_ARM ) #define F16_MAX ((float16_t)FLT_MAX) #endif #define F64_MIN (-DBL_MAX) #define F32_MIN (-FLT_MAX) -#if defined(ARM_MATH_FLOAT16) +#if !defined( __CC_ARM ) #define F16_MIN (-(float16_t)FLT_MAX) #endif #define F64_ABSMAX ((float64_t)DBL_MAX) #define F32_ABSMAX ((float32_t)FLT_MAX) -#if defined(ARM_MATH_FLOAT16) +#if !defined( __CC_ARM ) #define F16_ABSMAX ((float16_t)FLT_MAX) #endif #define F64_ABSMIN ((float64_t)0.0) #define F32_ABSMIN ((float32_t)0.0) -#if defined(ARM_MATH_FLOAT16) +#if !defined( __CC_ARM ) #define F16_ABSMIN ((float16_t)0.0) #endif @@ -2956,6 +2958,7 @@ void arm_mat_init_f32( float32_t * pDst, uint32_t blockSize); +#if !defined( __CC_ARM ) /** * @brief Floating-point vector multiplication. * @param[in] pSrcA points to the first input vector @@ -2968,6 +2971,7 @@ void arm_mat_init_f32( const float16_t * pSrcB, float16_t * pDst, uint32_t blockSize); +#endif /** * @brief Instance structure for the Q15 CFFT/CIFFT function. @@ -3092,6 +3096,8 @@ void arm_mat_init_f32( /** * @brief Instance structure for the floating-point CFFT/CIFFT function. */ + +#if !defined( __CC_ARM ) typedef struct { uint16_t fftLen; /**< length of the FFT. */ @@ -3103,6 +3109,7 @@ void arm_mat_init_f32( uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ float16_t onebyfftLen; /**< value of 1/fftLen. */ } arm_cfft_radix2_instance_f16; +#endif /* Deprecated */ arm_status arm_cfft_radix2_init_f32( @@ -3134,6 +3141,7 @@ void arm_mat_init_f32( /** * @brief Instance structure for the floating-point CFFT/CIFFT function. */ +#if !defined( __CC_ARM ) typedef struct { uint16_t fftLen; /**< length of the FFT. */ @@ -3145,6 +3153,7 @@ void arm_mat_init_f32( uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ float16_t onebyfftLen; /**< value of 1/fftLen. */ } arm_cfft_radix4_instance_f16; +#endif /* Deprecated */ arm_status arm_cfft_radix4_init_f32( @@ -3238,6 +3247,7 @@ void arm_cfft_q31( /** * @brief Instance structure for the floating-point CFFT/CIFFT function. */ +#if !defined( __CC_ARM ) typedef struct { uint16_t fftLen; /**< length of the FFT. */ @@ -3253,6 +3263,7 @@ void arm_cfft_q31( const float16_t *rearranged_twiddle_stride3; #endif } arm_cfft_instance_f16; +#endif arm_status arm_cfft_init_f32( arm_cfft_instance_f32 * S, @@ -3264,6 +3275,7 @@ void arm_cfft_q31( uint8_t ifftFlag, uint8_t bitReverseFlag); +#if !defined( __CC_ARM ) arm_status arm_cfft_init_f16( arm_cfft_instance_f16 * S, uint16_t fftLen); @@ -3273,6 +3285,7 @@ void arm_cfft_q31( float16_t * p1, uint8_t ifftFlag, uint8_t bitReverseFlag); +#endif /** * @brief Instance structure for the Double Precision Floating-point CFFT/CIFFT function. @@ -3572,6 +3585,7 @@ arm_status arm_rfft_fast_init_f32 ( float32_t * pDst, uint32_t blockSize); +#if !defined( __CC_ARM ) /** * @brief Floating-point vector addition. * @param[in] pSrcA points to the first input vector @@ -3584,7 +3598,7 @@ arm_status arm_rfft_fast_init_f32 ( const float16_t * pSrcB, float16_t * pDst, uint32_t blockSize); - +#endif /** * @brief Q7 vector addition. @@ -3641,6 +3655,7 @@ arm_status arm_rfft_fast_init_f32 ( float32_t * pDst, uint32_t blockSize); +#if !defined( __CC_ARM ) /** * @brief Floating-point vector subtraction. * @param[in] pSrcA points to the first input vector @@ -3653,6 +3668,7 @@ arm_status arm_rfft_fast_init_f32 ( const float16_t * pSrcB, float16_t * pDst, uint32_t blockSize); +#endif /** * @brief Q7 vector subtraction. @@ -3709,6 +3725,7 @@ arm_status arm_rfft_fast_init_f32 ( float32_t * pDst, uint32_t blockSize); +#if !defined( __CC_ARM ) /** * @brief Multiplies a floating-point vector by a scalar. * @param[in] pSrc points to the input vector @@ -3721,7 +3738,7 @@ arm_status arm_rfft_fast_init_f32 ( float16_t scale, float16_t * pDst, uint32_t blockSize); - +#endif /** * @brief Multiplies a Q7 vector by a scalar. @@ -3794,6 +3811,7 @@ arm_status arm_rfft_fast_init_f32 ( float32_t * pDst, uint32_t blockSize); +#if !defined( __CC_ARM ) /** * @brief Floating-point vector absolute value. * @param[in] pSrc points to the input buffer @@ -3804,6 +3822,7 @@ arm_status arm_rfft_fast_init_f32 ( const float16_t * pSrc, float16_t * pDst, uint32_t blockSize); +#endif /** @@ -3843,6 +3862,7 @@ arm_status arm_rfft_fast_init_f32 ( uint32_t blockSize, float32_t * result); +#if !defined( __CC_ARM ) /** * @brief Dot product of floating-point vectors. * @param[in] pSrcA points to the first input vector @@ -3855,7 +3875,7 @@ arm_status arm_rfft_fast_init_f32 ( const float16_t * pSrcB, uint32_t blockSize, float16_t * result); - +#endif /** * @brief Dot product of Q7 vectors. @@ -3954,6 +3974,7 @@ arm_status arm_rfft_fast_init_f32 ( float32_t * pDst, uint32_t blockSize); +#if !defined( __CC_ARM ) /** * @brief Adds a constant offset to a floating-point vector. * @param[in] pSrc points to the input vector @@ -3966,6 +3987,7 @@ arm_status arm_rfft_fast_init_f32 ( float16_t offset, float16_t * pDst, uint32_t blockSize); +#endif /** * @brief Adds a constant offset to a Q7 vector. @@ -4020,6 +4042,7 @@ arm_status arm_rfft_fast_init_f32 ( float32_t * pDst, uint32_t blockSize); +#if !defined( __CC_ARM ) /** * @brief Negates the elements of a floating-point vector. * @param[in] pSrc points to the input vector @@ -4030,7 +4053,7 @@ arm_status arm_rfft_fast_init_f32 ( const float16_t * pSrc, float16_t * pDst, uint32_t blockSize); - +#endif /** * @brief Negates the elements of a Q7 vector. * @param[in] pSrc points to the input vector diff --git a/Platforms/FVP/ARMv81MML/system_ARMv81MML.c b/Platforms/FVP/ARMv81MML/system_ARMv81MML.c index 069e1d0c..1d6a716f 100644 --- a/Platforms/FVP/ARMv81MML/system_ARMv81MML.c +++ b/Platforms/FVP/ARMv81MML/system_ARMv81MML.c @@ -98,5 +98,6 @@ void SystemInit (void) // enable DL branch cache CCR |= CCR_DL; + __ISB(); } diff --git a/Testing/CMakeLists.txt b/Testing/CMakeLists.txt index 14190a35..3ec47301 100644 --- a/Testing/CMakeLists.txt +++ b/Testing/CMakeLists.txt @@ -168,7 +168,6 @@ set(TESTSRC Source/Tests/BayesF32.cpp Source/Tests/TransformCF64.cpp Source/Tests/TransformCF32.cpp - Source/Tests/TransformCF16.cpp Source/Tests/TransformRF64.cpp Source/Tests/TransformRF32.cpp Source/Tests/TransformCQ31.cpp diff --git a/Testing/FrameworkInclude/Error.h b/Testing/FrameworkInclude/Error.h index ffb0aec7..052071e3 100644 --- a/Testing/FrameworkInclude/Error.h +++ b/Testing/FrameworkInclude/Error.h @@ -79,9 +79,10 @@ to get the line number. (SNR functions to finish implementing) */ - +#if !defined( __CC_ARM ) extern void assert_relative_error(unsigned long nb,float16_t &a, float16_t &b, double threshold); extern void assert_relative_error(unsigned long nb,AnyPattern &pa, AnyPattern &pb, double threshold); +#endif extern void assert_relative_error(unsigned long nb,float32_t &a, float32_t &b, double threshold); extern void assert_relative_error(unsigned long nb,AnyPattern &pa, AnyPattern &pb, double threshold); @@ -96,12 +97,17 @@ extern void assert_close_error(unsigned long nb,AnyPattern &pref, Any extern void assert_close_error(unsigned long nb,float32_t &ref, float32_t &val, double absthreshold, double relthreshold); extern void assert_close_error(unsigned long nb,AnyPattern &pref, AnyPattern &pval, double absthreshold, double relthreshold); +#if !defined( __CC_ARM ) extern void assert_close_error(unsigned long nb,float16_t &ref, float16_t &val, double absthreshold, double relthreshold); extern void assert_close_error(unsigned long nb,AnyPattern &pref, AnyPattern &pval, double absthreshold, double relthreshold); +#endif extern void assert_snr_error(unsigned long nb,AnyPattern &pa,AnyPattern &pb, float64_t threshold); extern void assert_snr_error(unsigned long nb,AnyPattern &pa,AnyPattern &pb, float32_t threshold); + +#if !defined( __CC_ARM ) extern void assert_snr_error(unsigned long nb,AnyPattern &pa,AnyPattern &pb, float32_t threshold); +#endif extern void assert_snr_error(unsigned long nb,AnyPattern &pa,AnyPattern &pb, float32_t threshold); extern void assert_snr_error(unsigned long nb,AnyPattern &pa,AnyPattern &pb, float32_t threshold); @@ -125,7 +131,11 @@ extern void assert_false(unsigned long nb,bool cond); extern void assert_not_empty(unsigned long nb, AnyPattern &p); extern void assert_not_empty(unsigned long nb, AnyPattern &p); + +#if !defined( __CC_ARM ) extern void assert_not_empty(unsigned long nb, AnyPattern &p); +#endif + extern void assert_not_empty(unsigned long nb, AnyPattern &p); extern void assert_not_empty(unsigned long nb, AnyPattern &p); extern void assert_not_empty(unsigned long nb, AnyPattern &p); diff --git a/Testing/FrameworkInclude/FPGA.h b/Testing/FrameworkInclude/FPGA.h index 3740cefc..fcdaffc1 100644 --- a/Testing/FrameworkInclude/FPGA.h +++ b/Testing/FrameworkInclude/FPGA.h @@ -60,7 +60,9 @@ FPGA driver. Used to read a C array describing how to drive the test. virtual void ImportPattern_f64(Testing::PatternID_t,char*,Testing::nbSamples_t nb); virtual void ImportPattern_f32(Testing::PatternID_t,char*,Testing::nbSamples_t nb); +#if !defined( __CC_ARM ) virtual void ImportPattern_f16(Testing::PatternID_t,char*,Testing::nbSamples_t nb); +#endif virtual void ImportPattern_q63(Testing::PatternID_t,char*,Testing::nbSamples_t nb); virtual void ImportPattern_q31(Testing::PatternID_t,char*,Testing::nbSamples_t nb); virtual void ImportPattern_q15(Testing::PatternID_t,char*,Testing::nbSamples_t nb); @@ -76,7 +78,9 @@ FPGA driver. Used to read a C array describing how to drive the test. virtual void DumpPattern_f64(Testing::outputID_t,Testing::nbSamples_t nb, float64_t* data); virtual void DumpPattern_f32(Testing::outputID_t,Testing::nbSamples_t nb, float32_t* data); +#if !defined( __CC_ARM ) virtual void DumpPattern_f16(Testing::outputID_t,Testing::nbSamples_t nb, float16_t* data); +#endif virtual void DumpPattern_q63(Testing::outputID_t,Testing::nbSamples_t nb, q63_t* data); virtual void DumpPattern_q31(Testing::outputID_t,Testing::nbSamples_t nb, q31_t* data); virtual void DumpPattern_q15(Testing::outputID_t,Testing::nbSamples_t nb, q15_t* data); diff --git a/Testing/FrameworkInclude/Pattern.h b/Testing/FrameworkInclude/Pattern.h index 366dc2b5..4fb2283f 100644 --- a/Testing/FrameworkInclude/Pattern.h +++ b/Testing/FrameworkInclude/Pattern.h @@ -45,8 +45,10 @@ float64_t *loadPattern(Testing::PatternID_t id, PatternMgr *mgr,Testing::nbSampl template <> float32_t *loadPattern(Testing::PatternID_t id, PatternMgr *mgr,Testing::nbSamples_t &nb, Testing::nbSamples_t maxSamples); +#if !defined( __CC_ARM ) template <> float16_t *loadPattern(Testing::PatternID_t id, PatternMgr *mgr,Testing::nbSamples_t &nb, Testing::nbSamples_t maxSamples); +#endif template <> q63_t *loadPattern(Testing::PatternID_t id, PatternMgr *mgr,Testing::nbSamples_t &nb, Testing::nbSamples_t maxSamples); @@ -81,8 +83,10 @@ float64_t *localPattern(Testing::nbSamples_t nb, PatternMgr *mgr); template <> float32_t *localPattern(Testing::nbSamples_t nb, PatternMgr *mgr); +#if !defined( __CC_ARM ) template <> float16_t *localPattern(Testing::nbSamples_t nb, PatternMgr *mgr); +#endif template <> q63_t *localPattern(Testing::nbSamples_t nb, PatternMgr *mgr); @@ -107,7 +111,9 @@ uint8_t *localPattern(Testing::nbSamples_t nb, PatternMgr *mgr); extern void dumpPattern(Testing::outputID_t id,Testing::nbSamples_t nb,float64_t* data,PatternMgr *mgr); extern void dumpPattern(Testing::outputID_t id,Testing::nbSamples_t,float32_t*,PatternMgr *); +#if !defined( __CC_ARM ) extern void dumpPattern(Testing::outputID_t id,Testing::nbSamples_t,float16_t*,PatternMgr *); +#endif extern void dumpPattern(Testing::outputID_t id,Testing::nbSamples_t,q63_t*,PatternMgr *); extern void dumpPattern(Testing::outputID_t id,Testing::nbSamples_t,q31_t*,PatternMgr *); extern void dumpPattern(Testing::outputID_t id,Testing::nbSamples_t,q15_t*,PatternMgr *); diff --git a/Testing/FrameworkInclude/Semihosting.h b/Testing/FrameworkInclude/Semihosting.h index e488c0c2..452d8ea0 100644 --- a/Testing/FrameworkInclude/Semihosting.h +++ b/Testing/FrameworkInclude/Semihosting.h @@ -64,7 +64,9 @@ Semihosting driver. Used to read a text file describing how to drive the test. virtual void ImportPattern_f64(Testing::PatternID_t,char*,Testing::nbSamples_t nb=0); virtual void ImportPattern_f32(Testing::PatternID_t,char*,Testing::nbSamples_t nb=0); +#if !defined( __CC_ARM ) virtual void ImportPattern_f16(Testing::PatternID_t,char*,Testing::nbSamples_t nb=0); +#endif virtual void ImportPattern_q63(Testing::PatternID_t,char*,Testing::nbSamples_t nb=0); virtual void ImportPattern_q31(Testing::PatternID_t,char*,Testing::nbSamples_t nb=0); virtual void ImportPattern_q15(Testing::PatternID_t,char*,Testing::nbSamples_t nb=0); @@ -81,7 +83,9 @@ Semihosting driver. Used to read a text file describing how to drive the test. virtual void DumpPattern_f64(Testing::outputID_t,Testing::nbSamples_t nb, float64_t*); virtual void DumpPattern_f32(Testing::outputID_t,Testing::nbSamples_t nb, float32_t*); +#if !defined( __CC_ARM ) virtual void DumpPattern_f16(Testing::outputID_t,Testing::nbSamples_t nb, float16_t*); +#endif virtual void DumpPattern_q63(Testing::outputID_t,Testing::nbSamples_t nb, q63_t*); virtual void DumpPattern_q31(Testing::outputID_t,Testing::nbSamples_t nb, q31_t*); virtual void DumpPattern_q15(Testing::outputID_t,Testing::nbSamples_t nb, q15_t*); diff --git a/Testing/FrameworkInclude/Test.h b/Testing/FrameworkInclude/Test.h index 7226c7f3..250b8d2c 100644 --- a/Testing/FrameworkInclude/Test.h +++ b/Testing/FrameworkInclude/Test.h @@ -298,7 +298,9 @@ API of Memory managers used in the test framework */ virtual void ImportPattern_f64(Testing::PatternID_t,char*,Testing::nbSamples_t nb=MAX_NB_SAMPLES)=0; virtual void ImportPattern_f32(Testing::PatternID_t,char*,Testing::nbSamples_t nb=MAX_NB_SAMPLES)=0; +#if !defined( __CC_ARM ) virtual void ImportPattern_f16(Testing::PatternID_t,char*,Testing::nbSamples_t nb=MAX_NB_SAMPLES)=0; +#endif virtual void ImportPattern_q63(Testing::PatternID_t,char*,Testing::nbSamples_t nb=MAX_NB_SAMPLES)=0; virtual void ImportPattern_q31(Testing::PatternID_t,char*,Testing::nbSamples_t nb=MAX_NB_SAMPLES)=0; virtual void ImportPattern_q15(Testing::PatternID_t,char*,Testing::nbSamples_t nb=MAX_NB_SAMPLES)=0; @@ -328,7 +330,9 @@ API of Memory managers used in the test framework */ virtual void DumpPattern_f64(Testing::outputID_t,Testing::nbSamples_t nb, float64_t*)=0; virtual void DumpPattern_f32(Testing::outputID_t,Testing::nbSamples_t nb, float32_t*)=0; +#if !defined( __CC_ARM ) virtual void DumpPattern_f16(Testing::outputID_t,Testing::nbSamples_t nb, float16_t*)=0; +#endif virtual void DumpPattern_q63(Testing::outputID_t,Testing::nbSamples_t nb, q63_t*)=0; virtual void DumpPattern_q31(Testing::outputID_t,Testing::nbSamples_t nb, q31_t*)=0; virtual void DumpPattern_q15(Testing::outputID_t,Testing::nbSamples_t nb, q15_t*)=0; @@ -408,8 +412,9 @@ public: */ float64_t *load_f64(Testing::PatternID_t,Testing::nbSamples_t&,Testing::nbSamples_t maxSamples=MAX_NB_SAMPLES); float32_t *load_f32(Testing::PatternID_t,Testing::nbSamples_t&,Testing::nbSamples_t maxSamples=MAX_NB_SAMPLES); +#if !defined( __CC_ARM ) float16_t *load_f16(Testing::PatternID_t,Testing::nbSamples_t&,Testing::nbSamples_t maxSamples=MAX_NB_SAMPLES); - +#endif q63_t *load_q63(Testing::PatternID_t,Testing::nbSamples_t&,Testing::nbSamples_t maxSamples=MAX_NB_SAMPLES); q31_t *load_q31(Testing::PatternID_t,Testing::nbSamples_t&,Testing::nbSamples_t maxSamples=MAX_NB_SAMPLES); q15_t *load_q15(Testing::PatternID_t,Testing::nbSamples_t&,Testing::nbSamples_t maxSamples=MAX_NB_SAMPLES); @@ -427,7 +432,9 @@ public: */ float64_t *local_f64(Testing::nbSamples_t); float32_t *local_f32(Testing::nbSamples_t); +#if !defined( __CC_ARM ) float16_t *local_f16(Testing::nbSamples_t); +#endif q63_t *local_q63(Testing::nbSamples_t); q31_t *local_q31(Testing::nbSamples_t); q15_t *local_q15(Testing::nbSamples_t); @@ -442,8 +449,10 @@ public: */ void dumpPattern_f64(Testing::outputID_t,Testing::nbSamples_t,float64_t*); void dumpPattern_f32(Testing::outputID_t,Testing::nbSamples_t,float32_t*); +#if !defined( __CC_ARM ) void dumpPattern_f16(Testing::outputID_t,Testing::nbSamples_t,float16_t*); - +#endif + void dumpPattern_q63(Testing::outputID_t,Testing::nbSamples_t,q63_t*); void dumpPattern_q31(Testing::outputID_t,Testing::nbSamples_t,q31_t*); void dumpPattern_q15(Testing::outputID_t,Testing::nbSamples_t,q15_t*); diff --git a/Testing/FrameworkSource/Error.cpp b/Testing/FrameworkSource/Error.cpp index 0f6dfacd..8cf7ad87 100644 --- a/Testing/FrameworkSource/Error.cpp +++ b/Testing/FrameworkSource/Error.cpp @@ -135,10 +135,12 @@ void assert_not_empty(unsigned long nb, AnyPattern &p) assert_not_empty_generic(nb,p); } +#if !defined( __CC_ARM ) void assert_not_empty(unsigned long nb, AnyPattern &p) { assert_not_empty_generic(nb,p); } +#endif void assert_not_empty(unsigned long nb, AnyPattern &p) { @@ -215,6 +217,7 @@ void assert_relative_error(unsigned long nb,float32_t &a, float32_t &b, double t } }; +#if !defined( __CC_ARM ) void assert_relative_error(unsigned long nb,float16_t &a, float16_t &b, double threshold) { double rel,delta,average; @@ -234,6 +237,7 @@ void assert_relative_error(unsigned long nb,float16_t &a, float16_t &b, double t } } }; +#endif void assert_relative_error(unsigned long nb,AnyPattern &pa, AnyPattern &pb, double threshold) { @@ -297,6 +301,7 @@ void assert_relative_error(unsigned long nb,AnyPattern &pa, AnyPatter } }; +#if !defined( __CC_ARM ) void assert_relative_error(unsigned long nb,AnyPattern &pa, AnyPattern &pb, double threshold) { ASSERT_NOT_EMPTY(pa); @@ -327,6 +332,7 @@ void assert_relative_error(unsigned long nb,AnyPattern &pa, AnyPatter } } }; +#endif void assert_close_error(unsigned long nb,float64_t &ref, float64_t &val, double absthreshold,double relthreshold) { @@ -414,6 +420,7 @@ void assert_close_error(unsigned long nb,AnyPattern &pref, AnyPattern } }; +#if !defined( __CC_ARM ) void assert_close_error(unsigned long nb,float16_t &ref, float16_t &val, double absthreshold,double relthreshold) { @@ -456,6 +463,7 @@ void assert_close_error(unsigned long nb,AnyPattern &pref, AnyPattern } }; +#endif /** * @brief Calculation of SNR @@ -520,6 +528,7 @@ float arm_snr_f32(float *pRef, float *pTest, uint32_t buffSize) } +#if !defined( __CC_ARM ) float arm_snr_f16(float16_t *pRef, float16_t *pTest, uint32_t buffSize) { float EnergySignal = 0.0, EnergyError = 0.0; @@ -552,6 +561,7 @@ float arm_snr_f16(float16_t *pRef, float16_t *pTest, uint32_t buffSize) return (SNR); } +#endif float arm_snr_q63(q63_t *pRef, q63_t *pTest, uint32_t buffSize) { @@ -751,6 +761,7 @@ void assert_snr_error(unsigned long nb,float32_t a,float32_t b, float32_t thresh } } +#if !defined( __CC_ARM ) void assert_snr_error(unsigned long nb,AnyPattern &pa,AnyPattern &pb, float32_t threshold) { float32_t snr; @@ -777,6 +788,7 @@ void assert_snr_error(unsigned long nb,AnyPattern &pa,AnyPatterngetOutputPath(id); @@ -757,7 +760,8 @@ namespace Client printf("D: END\n"); } } - +#endif + void FPGA::DumpPattern_q63(Testing::outputID_t id,Testing::nbSamples_t nb, q63_t* data) { std::string fileName = this->getOutputPath(id); diff --git a/Testing/FrameworkSource/Pattern.cpp b/Testing/FrameworkSource/Pattern.cpp index 8e559040..98954613 100644 --- a/Testing/FrameworkSource/Pattern.cpp +++ b/Testing/FrameworkSource/Pattern.cpp @@ -45,11 +45,13 @@ float32_t *loadPattern(Testing::PatternID_t id, Client::PatternMgr *mgr,Testing: return(mgr->load_f32(id,nb,maxSamples)); } +#if !defined( __CC_ARM ) template <> float16_t *loadPattern(Testing::PatternID_t id, Client::PatternMgr *mgr,Testing::nbSamples_t &nb, Testing::nbSamples_t maxSamples) { return(mgr->load_f16(id,nb,maxSamples)); } +#endif template <> q63_t *loadPattern(Testing::PatternID_t id, Client::PatternMgr *mgr,Testing::nbSamples_t &nb, Testing::nbSamples_t maxSamples) @@ -106,11 +108,13 @@ float32_t *localPattern(Testing::PatternID_t id, Client::PatternMgr *mgr) return(mgr->local_f32(id)); } +#if !defined( __CC_ARM ) template <> float16_t *localPattern(Testing::PatternID_t id, Client::PatternMgr *mgr) { return(mgr->local_f16(id)); } +#endif template <> q63_t *localPattern(Testing::PatternID_t id, Client::PatternMgr *mgr) @@ -164,10 +168,12 @@ void dumpPattern(Testing::outputID_t id,Testing::nbSamples_t nbSamples,float32_t mgr->dumpPattern_f32(id,nbSamples,data); } +#if !defined( __CC_ARM ) void dumpPattern(Testing::outputID_t id,Testing::nbSamples_t nbSamples,float16_t* data,PatternMgr *mgr) { mgr->dumpPattern_f16(id,nbSamples,data); } +#endif void dumpPattern(Testing::outputID_t id,Testing::nbSamples_t nbSamples,q63_t* data,PatternMgr *mgr) { diff --git a/Testing/FrameworkSource/PatternMgr.cpp b/Testing/FrameworkSource/PatternMgr.cpp index b6f14ae7..8498942c 100644 --- a/Testing/FrameworkSource/PatternMgr.cpp +++ b/Testing/FrameworkSource/PatternMgr.cpp @@ -46,7 +46,9 @@ TYPE *PatternMgr::local_##EXT(Testing::nbSamples_t nbSamples) \ LOCAL(float64_t,f64) LOCAL(float32_t,f32) +#if !defined( __CC_ARM ) LOCAL(float16_t,f16) +#endif LOCAL(q63_t,q63) LOCAL(q31_t,q31) LOCAL(q15_t,q15) @@ -92,6 +94,7 @@ float32_t *PatternMgr::load_f32(Testing::PatternID_t id,Testing::nbSamples_t& nb } +#if !defined( __CC_ARM ) float16_t *PatternMgr::load_f16(Testing::PatternID_t id,Testing::nbSamples_t& nbSamples,Testing::nbSamples_t maxSamples) { nbSamples=m_io->GetPatternSize(id); @@ -109,6 +112,7 @@ float16_t *PatternMgr::load_f16(Testing::PatternID_t id,Testing::nbSamples_t& nb return((float16_t*)b); } +#endif q63_t *PatternMgr::load_q63(Testing::PatternID_t id,Testing::nbSamples_t& nbSamples,Testing::nbSamples_t maxSamples) { @@ -241,10 +245,12 @@ void PatternMgr::dumpPattern_f32(Testing::outputID_t id,Testing::nbSamples_t nbS m_io->DumpPattern_f32(id,nbSamples,data); } +#if !defined( __CC_ARM ) void PatternMgr::dumpPattern_f16(Testing::outputID_t id,Testing::nbSamples_t nbSamples,float16_t* data) { m_io->DumpPattern_f16(id,nbSamples,data); } +#endif void PatternMgr::dumpPattern_q63(Testing::outputID_t id,Testing::nbSamples_t nbSamples,q63_t* data) { diff --git a/Testing/FrameworkSource/Semihosting.cpp b/Testing/FrameworkSource/Semihosting.cpp index 0b6a92ba..8313b4d5 100644 --- a/Testing/FrameworkSource/Semihosting.cpp +++ b/Testing/FrameworkSource/Semihosting.cpp @@ -668,6 +668,7 @@ namespace Client } +#if !defined( __CC_ARM ) void Semihosting::ImportPattern_f16(Testing::PatternID_t id,char* p,Testing::nbSamples_t nb) { char tmp[256]; @@ -708,6 +709,7 @@ namespace Client fclose(pattern); } +#endif void Semihosting::ImportPattern_q63(Testing::PatternID_t id,char* p,Testing::nbSamples_t nb) { @@ -1013,6 +1015,7 @@ namespace Client } } +#if !defined( __CC_ARM ) void Semihosting::DumpPattern_f16(Testing::outputID_t id,Testing::nbSamples_t nb, float16_t* data) { std::string fileName = this->getOutputPath(id); @@ -1031,7 +1034,8 @@ namespace Client fclose(f); } } - +#endif + void Semihosting::DumpPattern_q63(Testing::outputID_t id,Testing::nbSamples_t nb, q63_t* data) { std::string fileName = this->getOutputPath(id); diff --git a/Testing/TestScripts/Regression/Commands.py b/Testing/TestScripts/Regression/Commands.py index a250c5af..f3deaf30 100755 --- a/Testing/TestScripts/Regression/Commands.py +++ b/Testing/TestScripts/Regression/Commands.py @@ -166,15 +166,6 @@ class BuildConfig: ] cmd += flags cmd += ["-DBENCHMARK=OFF", - "-DFULLYCONNECTED=OFF", - "-DCONVOLUTION=OFF", - "-DACTIVATION=OFF", - "-DPOOLING=OFF", - "-DSOFTMAX=OFF", - "-DNNSUPPORT=OFF", - "-DBASICMATHSNN=OFF", - "-DRESHAPE=OFF", - "-DCONCATENATION=OFF", "-DWRAPPER=OFF", "-DCONFIGTABLE=OFF", "-DROOT=%s" % self._rootFolder,