[PATCH] D47675: [test-suite][RFC] Using Google Benchmark Library on Harris Kernel

Pankaj via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 13 18:22:40 PDT 2018


proton added a comment.

In https://reviews.llvm.org/D47675#1131201, @Meinersbur wrote:

> Could you check whether llvm-lit correctly collects execution time, compile/link time, LLVM -stats, code size?


I don't know how to check LLVM -stats using lit. 
Sizes matches the output of llvm-size, compile time and link time are also fine.

lit Output: used "lit ." in build/Microbenchmark/harris
compile_time: 1.3595
link_time: 0.0832
exec size: 364288
exec_time:  28254000.0000
Testing Time: 1.22s
.
.
.

For now, I have merged the init.cpp and main.cpp. The image initialization here is special to visualize the output nicely. We may/may not use this initialization for other image processing kernels.
If at all there is a common image initialization source code introduced in future (maybe with multiple type of image init and some helper function that helps in image processing), there will be only minute changes to `main.cpp` file.

Here are some of the stats for this code:

RunTime
-------

With Benchmark library

| Flag       | CPU Time    | Iteration | System measured (using time ./a.out) |
| ---------- | ----------- | --------- | ------------------------------------ |
| `O0`       | 117259447ns | 6         | 1.039s                               |
| `O3`       | 32498956ns  | 21        | 1.214s                               |
| `O3+Polly` | 32562202ns  | 21        | 1.205s                               |
|

Without Benchmark library (input size is changed - refer `harris.h`)

| Flag       | System measured time |
| ---------- | -------------------- |
| `O0`       | 1.241s               |
| `O3`       | 0.697s               |
| `O3+Polly` | 0.611s               |
|

**Note**: Clang is built in debug mode and I have compiled benchmark using clang++ -O3 -mllvm -polly --std=c++11 harrisKernel.cpp main.cpp -lbenchmark -lpthread -o withPolly.out

lit --vg --vg-leak
------------------

It Fails... but so does other benchmarks in microbenchmark folder so maybe there is memory leak problem with benchmark library

I am thinking of manually verifying output as there is a pattern to output with this checkbox initialization, let me know if it is a good idea or not. 
I have removed the reference output for now as it is of size 10MB, I will update the diff with reference output once the checking method is finalized.


https://reviews.llvm.org/D47675





More information about the llvm-commits mailing list