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

Dean Michael Berris via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 20 18:57:26 PDT 2018


dberris added a comment.

Thanks for making some of the changes. I'm still not clear on a couple of things.

Do you mind sharing some of the results with the new benchmark runs, with the different image sizes? Do we actually get the throughput numbers in there as well?



================
Comment at: MicroBenchmarks/harris/main.cpp:111-119
+  int height = state.range(0);
+  int width = state.range(1);
+
+  float (* image)[HEIGHT + 2][WIDTH + 2];
+  image  = (float(*)[2+HEIGHT][2+WIDTH]) malloc(sizeof(float)* (2+HEIGHT) * (2+WIDTH));
+  initCheckboardImage((HEIGHT + 2), (WIDTH + 2), *image);
+
----------------
Why are these still using `HEIGHT` and `WIDTH`? Why aren't these just:

```
const size_t height = state.range(0);
const size_t weight = state.range(1);

float **image = reinterpret_cast<float**>(malloc(sizeof(float) * (2 + height) * (2 + width)));
float **imageOutput = reinterpret_cast<float**>(malloc(sizeof(float) * (2 + height) * (2 + width)));
```


================
Comment at: MicroBenchmarks/harris/main.cpp:185
+}
+BENCHMARK(BENCHMARK_HARRIS)->Args({256, 256})->Args({512, 512})->Args({1024, 1024})->Args({2048, 2048})->Unit(benchmark::kMicrosecond);
+
----------------
Can you re-format this? Preferably with clang-format if possible, so that it's easier to read.


https://reviews.llvm.org/D47675





More information about the llvm-commits mailing list