From 7accd563b97227e2ac3d57dbb1c69476860d0f1b Mon Sep 17 00:00:00 2001 From: Christophe Favergeon Date: Fri, 18 Sep 2020 14:14:27 +0200 Subject: [PATCH] CMSIS-DSP: Corrected script for html generation --- Source/CommonTables/arm_const_structs_f16.c | 18 +++++----- Source/fft.cmake | 17 ++++++++++ Testing/Source/Benchmarks/TransformF16.cpp | 3 ++ Testing/TestScripts/doc/Format.py | 37 +++++++++++++++------ Testing/TestScripts/doc/Structure.py | 8 +++++ Testing/bench.txt | 2 +- Testing/extractDb.py | 24 +++++++++---- 7 files changed, 83 insertions(+), 26 deletions(-) diff --git a/Source/CommonTables/arm_const_structs_f16.c b/Source/CommonTables/arm_const_structs_f16.c index 18c276f9..fa4a420c 100755 --- a/Source/CommonTables/arm_const_structs_f16.c +++ b/Source/CommonTables/arm_const_structs_f16.c @@ -57,55 +57,55 @@ For the MVE version, the new arm_cfft_init_f32 must be used. #if !defined(__CC_ARM) -#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_F16_16) && defined(ARM_TABLE_BITREVIDX_FXT_16)) +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_F16_16) && defined(ARM_TABLE_BITREVIDX_FLT_16)) const arm_cfft_instance_f16 arm_cfft_sR_f16_len16 = { 16, twiddleCoefF16_16, armBitRevIndexTable_fixed_16, ARMBITREVINDEXTABLE_FIXED_16_TABLE_LENGTH }; #endif -#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_F16_32) && defined(ARM_TABLE_BITREVIDX_FXT_32)) +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_F16_32) && defined(ARM_TABLE_BITREVIDX_FLT_32)) const arm_cfft_instance_f16 arm_cfft_sR_f16_len32 = { 32, twiddleCoefF16_32, armBitRevIndexTable_fixed_32, ARMBITREVINDEXTABLE_FIXED_32_TABLE_LENGTH }; #endif -#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_F16_64) && defined(ARM_TABLE_BITREVIDX_FXT_64)) +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_F16_64) && defined(ARM_TABLE_BITREVIDX_FLT_64)) const arm_cfft_instance_f16 arm_cfft_sR_f16_len64 = { 64, twiddleCoefF16_64, armBitRevIndexTable_fixed_64, ARMBITREVINDEXTABLE_FIXED_64_TABLE_LENGTH }; #endif -#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_F16_128) && defined(ARM_TABLE_BITREVIDX_FXT_128)) +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_F16_128) && defined(ARM_TABLE_BITREVIDX_FLT_128)) const arm_cfft_instance_f16 arm_cfft_sR_f16_len128 = { 128, twiddleCoefF16_128, armBitRevIndexTable_fixed_128, ARMBITREVINDEXTABLE_FIXED_128_TABLE_LENGTH }; #endif -#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_F16_256) && defined(ARM_TABLE_BITREVIDX_FXT_256)) +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_F16_256) && defined(ARM_TABLE_BITREVIDX_FLT_256)) const arm_cfft_instance_f16 arm_cfft_sR_f16_len256 = { 256, twiddleCoefF16_256, armBitRevIndexTable_fixed_256, ARMBITREVINDEXTABLE_FIXED_256_TABLE_LENGTH }; #endif -#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_F16_512) && defined(ARM_TABLE_BITREVIDX_FXT_512)) +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_F16_512) && defined(ARM_TABLE_BITREVIDX_FLT_512)) const arm_cfft_instance_f16 arm_cfft_sR_f16_len512 = { 512, twiddleCoefF16_512, armBitRevIndexTable_fixed_512, ARMBITREVINDEXTABLE_FIXED_512_TABLE_LENGTH }; #endif -#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_F16_1024) && defined(ARM_TABLE_BITREVIDX_FXT_1024)) +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_F16_1024) && defined(ARM_TABLE_BITREVIDX_FLT_1024)) const arm_cfft_instance_f16 arm_cfft_sR_f16_len1024 = { 1024, twiddleCoefF16_1024, armBitRevIndexTable_fixed_1024, ARMBITREVINDEXTABLE_FIXED_1024_TABLE_LENGTH }; #endif -#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_F16_2048) && defined(ARM_TABLE_BITREVIDX_FXT_2048)) +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_F16_2048) && defined(ARM_TABLE_BITREVIDX_FLT_2048)) const arm_cfft_instance_f16 arm_cfft_sR_f16_len2048 = { 2048, twiddleCoefF16_2048, armBitRevIndexTable_fixed_2048, ARMBITREVINDEXTABLE_FIXED_2048_TABLE_LENGTH }; #endif -#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_F16_4096) && defined(ARM_TABLE_BITREVIDX_FXT_4096)) +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_F16_4096) && defined(ARM_TABLE_BITREVIDX_FLT_4096)) const arm_cfft_instance_f16 arm_cfft_sR_f16_len4096 = { 4096, twiddleCoefF16_4096, armBitRevIndexTable_fixed_4096, ARMBITREVINDEXTABLE_FIXED_4096_TABLE_LENGTH }; diff --git a/Source/fft.cmake b/Source/fft.cmake index 9615dd49..c1f9d8ca 100644 --- a/Source/fft.cmake +++ b/Source/fft.cmake @@ -94,46 +94,55 @@ endif() if (CONFIGTABLE AND CFFT_F16_16) target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_16) + target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FLT_16) target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FXT_16) endif() if (CONFIGTABLE AND CFFT_F16_32) target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_32) + target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FLT_32) target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FXT_32) endif() if (CONFIGTABLE AND CFFT_F16_64) target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_64) + target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FLT_64) target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FXT_64) endif() if (CONFIGTABLE AND CFFT_F16_128) target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_128) + target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FLT_128) target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FXT_128) endif() if (CONFIGTABLE AND CFFT_F16_256) target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_256) + target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FLT_256) target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FXT_256) endif() if (CONFIGTABLE AND CFFT_F16_512) target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_512) + target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FLT_512) target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FXT_512) endif() if (CONFIGTABLE AND CFFT_F16_1024) target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_1024) + target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FLT_1024) target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FXT_1024) endif() if (CONFIGTABLE AND CFFT_F16_2048) target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_2048) + target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FLT_2048) target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FXT_2048) endif() if (CONFIGTABLE AND CFFT_F16_4096) target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_4096) + target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FLT_4096) target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FXT_4096) endif() @@ -409,48 +418,56 @@ endif() if (CONFIGTABLE AND RFFT_FAST_F16_32) target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_16) + target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FLT_16) target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FXT_16) target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_RFFT_F16_32) endif() if (CONFIGTABLE AND RFFT_FAST_F16_64) target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_32) + target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FLT_32) target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FXT_32) target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_RFFT_F16_64) endif() if (CONFIGTABLE AND RFFT_FAST_F16_128) target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_64) + target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FLT_64) target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FXT_64) target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_RFFT_F16_128) endif() if (CONFIGTABLE AND RFFT_FAST_F16_256) target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_128) + target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FLT_128) target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FXT_128) target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_RFFT_F16_256) endif() if (CONFIGTABLE AND RFFT_FAST_F16_512) target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_256) + target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FLT_256) target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FXT_256) target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_RFFT_F16_512) endif() if (CONFIGTABLE AND RFFT_FAST_F16_1024) target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_512) + target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FLT_512) target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FXT_512) target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_RFFT_F16_1024) endif() if (CONFIGTABLE AND RFFT_FAST_F16_2048) target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_1024) + target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FLT_1024) target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FXT_1024) target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_RFFT_F16_2048) endif() if (CONFIGTABLE AND RFFT_FAST_F16_4096) target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_2048) + target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FLT_2048) target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FXT_2048) target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_RFFT_F16_4096) endif() diff --git a/Testing/Source/Benchmarks/TransformF16.cpp b/Testing/Source/Benchmarks/TransformF16.cpp index 41209d3e..653a5670 100755 --- a/Testing/Source/Benchmarks/TransformF16.cpp +++ b/Testing/Source/Benchmarks/TransformF16.cpp @@ -45,6 +45,7 @@ break; case TEST_RFFT_F16_2: + { // Factor 2 for irfft samples.reload(TransformF16::INPUTR_F16_ID,mgr,2*this->nbSamples); output.create(2*this->nbSamples,TransformF16::OUT_F16_ID,mgr); @@ -56,7 +57,9 @@ memcpy(this->pTmp,this->pSrc,sizeof(float16_t)*this->nbSamples); + arm_rfft_fast_init_f16(&this->rfftFastInstance, this->nbSamples); + } break; case TEST_CFFT_RADIX4_F16_3: diff --git a/Testing/TestScripts/doc/Format.py b/Testing/TestScripts/doc/Format.py index 0f272a2f..9c76a935 100755 --- a/Testing/TestScripts/doc/Format.py +++ b/Testing/TestScripts/doc/Format.py @@ -108,9 +108,10 @@ html { } html, body { - background-color: #f3f2ee; - font-family: "PT Serif", 'Times New Roman', Times, serif; - color: #1f0909; + background-color: #E5ECEB; + font-family: "Lato"; + font-style: normal; font-variant: normal; + color: #002B49; line-height: 1.5em; } @@ -121,6 +122,15 @@ body { } +.NA { + color: #999999; +} + +.testname { + color: #0091BD; + font-size: 1.125em; +} + h1, h2, h3, @@ -181,10 +191,10 @@ td { background-color: transparent; } thead { - background-color: #dadada; + background-color: #979ea3; } tr:nth-child(even) { - background: #e8e7e7; + background: #d7dadc; } ul, #myUL { @@ -232,7 +242,7 @@ ul, #myUL { .firstcore { border-left-color: black; border-left-style: solid; - border-left-width: 1px; + border-left-width: 2px; } @@ -592,17 +602,20 @@ myhist(thehdata%d,"#hi%d"); row = params + values for elem in row: + txt=str(elem) + if txt == 'NA': + txt = "" + txt + "" if i < nbParams: self._output.write("") - self._output.write(str(elem)) + self._output.write(txt) self._output.write("\n") elif i == nbParams and nbParams != 0: self._output.write("") - self._output.write(str(elem)) + self._output.write(txt) self._output.write("\n") else: self._output.write("") - self._output.write(str(elem)) + self._output.write(txt) self._output.write("\n") i = i + 1 self._output.write("\n") @@ -612,7 +625,10 @@ myhist(thehdata%d,"#hi%d"); def visitSection(self,section): self._id = self._id + 1 self._sectionID = self._sectionID + 1 - self._output.write("%s\n" % (self._id,self._sectionID,section.name,self._id)) + name = section.name + if section.isTest: + name = "" + name + "" + self._output.write("%s\n" % (self._id,self._sectionID,name,self._id)) def leaveSection(self,section): self._id = self._id - 1 @@ -622,6 +638,7 @@ myhist(thehdata%d,"#hi%d"); + Benchmarks%s\n""" % styleSheet) if self._regMode and not self._ratioMode: self._output.write("

ECPS Benchmark Regressions

\n") diff --git a/Testing/TestScripts/doc/Structure.py b/Testing/TestScripts/doc/Structure.py index 6abd76ab..b16f91ba 100755 --- a/Testing/TestScripts/doc/Structure.py +++ b/Testing/TestScripts/doc/Structure.py @@ -60,10 +60,18 @@ class Section(Hierarchy): def __init__(self,name): super(Section, self).__init__(name) self._content = [] + self._testname=False def addContent(self,content): self._content.append(content) + @property + def isTest(self): + return(self._testname) + + def setTest(self): + self._testname = True + @property def hasContent(self): return(len(self._content) > 0 or any([x.hasContent for x in self.sections])) diff --git a/Testing/bench.txt b/Testing/bench.txt index 24e8e107..6fd49bb5 100755 --- a/Testing/bench.txt +++ b/Testing/bench.txt @@ -1607,7 +1607,7 @@ group Root { Params RFFT_PARAM_ID = { NB = [64,128,256] IFFT = [0,1] - REV = [0,1] + REV = [1] } Params DCT_PARAM_ID = { diff --git a/Testing/extractDb.py b/Testing/extractDb.py index d6179c15..73b79a87 100755 --- a/Testing/extractDb.py +++ b/Testing/extractDb.py @@ -471,14 +471,21 @@ def getColNamesAndDataForCompiler(benchTable,comp,typeid): vals =np.array([list(x) for x in list(result)]) return(keepCols,vals) - +def formatFloat(s): + result=[] + for t in s: + if type(t) is float: + result.append(("%.3f" % t)) + else: + result.append(t) + return(result) PARAMS=["NB","NumTaps", "NBA", "NBB", "Factor", "NumStages","VECDIM","NBR","NBC","NBI","IFFT", "BITREV"] def regressionTableFor(byname,name,section,ref,toSort,indexCols,field): data=ref.pivot_table(index=indexCols, columns=byname, - values=[field], aggfunc='first') - + values=[field], aggfunc='first',fill_value="NA") + data=data.sort_values(toSort) cores = [c[1] for c in list(data.columns)] @@ -499,14 +506,14 @@ def regressionTableFor(byname,name,section,ref,toSort,indexCols,field): row=list(row[0]) + row[1:] if field=="MAXREGCOEF": newrow = row - newrow[len(columns):] = [("%.3f" % x) for x in row[len(columns):]] + newrow[len(columns):] = formatFloat(row[len(columns):]) row=newrow dataTable.addRow(row) bars['data'].append(row) return(bars) else: if field=="MAXREGCOEF": - dataForFunc=[("%.3f" % x) for x in dataForFunc] + dataForFunc=formatFloat(dataForFunc) dataTable.addRow(dataForFunc) return(list(zip(cores,dataForFunc))) @@ -599,6 +606,7 @@ def formatTableBy(desc,byname,section,typeSection,testNames,cols,vals): for name in testNames: if args.r: testSection = Section(name) + testSection.setTest() typeSection.addSection(testSection) maxCyclesSection = Section("Max cycles") @@ -638,13 +646,14 @@ def formatTableBy(desc,byname,section,typeSection,testNames,cols,vals): else: data=ref.pivot_table(index=indexCols, columns=byname, - values=valList, aggfunc='first') + values=valList, aggfunc='first',fill_value="NA") data=data.sort_values(toSort) #print(list(data.columns)) testSection = Section(name) + testSection.setTest() typeSection.addSection(testSection) dataForFunc=data.loc[name] @@ -837,6 +846,8 @@ def formatPerfRatio(s): return(result) + + def addRatioTable(cols,params,data,section,testNames,byd): ref=pd.DataFrame(data,columns=cols) toSort=["name"] + params @@ -847,6 +858,7 @@ def addRatioTable(cols,params,data,section,testNames,byd): #print(testNames) for name in testNames: testSection = Section(name) + testSection.setTest() section.addSection(testSection) ratioSection = Section("Ratios")