summaryrefslogtreecommitdiff
path: root/utests/compiler_basic_arithmetic.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Statistics of case runningYi Sun2014-04-021-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | summary: ----------------- 1. Add struct RStatistics to count passed number(passCount), failed number(failCount), finished run number(finishrun). 2. Print statistics line , if the termial is too narrow, doesn't print it: ...... test_load_program_from_bin() [SUCCESS] profiling_exec() [SUCCESS] enqueue_copy_buf() [SUCCESS] [run/total: 656/656] pass: 629; fail: 25; pass rate: 0.961890 3. If case crashes, count it as failed, add the function to show statistic summary. 4. When all cases finished, list a summary like follows: summary: ---------- total: 656 run: 656 pass: 629 fail: 25 pass rate: 0.961890 5. If ./utest_run &> log, the log will be a little messy, tring the following command to analyse the log: sed 's/\r/\n/g' log | egrep "\w*\(\)" | sed -e 's/\s//g' After analysed: ----------------- ...... builtin_minmag_float2()[SUCCESS] builtin_minmag_float4()[SUCCESS] builtin_minmag_float8()[SUCCESS] builtin_minmag_float16()[SUCCESS] builtin_nextafter_float()[FAILED] builtin_nextafter_float2()[FAILED] builtin_nextafter_float4()[FAILED] ...... 6. Fix one issue, print out the crashed case name. 7. Delete the debug line in utests/compiler_basic_arithmetic.cpp, which output the kernel name. 8. Define function statistics() in struct UTest, which called by "utest_run -a/-c/-n". We just call this function to run each case, and print the statistics line. Reviewed-by: "Song, Ruiling" <ruiling.song@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
* Accelerate utest.Zhigang Gong2013-12-161-18/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For some test cases which include more than one kernel, the current implementation always build the program for a new sub test case. That wastes a lot of time. This patch introduce a new macro MAKE_UTEST_FROM_FUNCTION_KEEP_PROGRAM which has an extra parameter to specify whether to keep the previous program and avoid the extra build. The normal usage is: MAKE_UTEST_FROM_FUNCTION_KEEP_PROGRAM(fn1, true); MAKE_UTEST_FROM_FUNCTION_KEEP_PROGRAM(fn2, true); MAKE_UTEST_FROM_FUNCTION_KEEP_PROGRAM(fn3, true); MAKE_UTEST_FROM_FUNCTION_KEEP_PROGRAM(fn4, true); MAKE_UTEST_FROM_FUNCTION_KEEP_PROGRAM(fn5, false); The scenario is that the above fn1-5 are included in the same kernel file and we define the sub cases in the same cpp file. We already have some examples of this usage in the compiler_abs.cpp, compiler_abs_diff.cpp compiler_basic_arithmetic.cpp, compiler_vector_load_store.cpp, etc. This patch reduces 2/3 of the utests execution time. v2: should always destroy the program when run one specific test case. Signed-off-by: Zhigang Gong <zhigang.gong@intel.com> Reviewed-by: "Song, Ruiling" <ruiling.song@intel.com>
* utests: Add basic arithmetic test caseRuiling Song2013-06-261-0/+112
test case for + - * / % of data type (u)int8/16/32 remove duplicated cases. Signed-off-by: Ruiling Song <ruiling.song@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>