summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--misc/dotfiles/templates/benchmark.cpp17
-rw-r--r--roles/dotfiles/tasks/main.yml6
2 files changed, 23 insertions, 0 deletions
diff --git a/misc/dotfiles/templates/benchmark.cpp b/misc/dotfiles/templates/benchmark.cpp
new file mode 100644
index 0000000..ff0519b
--- /dev/null
+++ b/misc/dotfiles/templates/benchmark.cpp
@@ -0,0 +1,17 @@
+#include <benchmark/benchmark.h>
+
+static void BM_Baseline(benchmark::State& state) {
+ for (auto _ : state) {
+ __asm__("nop");
+ }
+}
+BENCHMARK(BM_Baseline);
+
+static void BM_Treatment(benchmark::State& state) {
+ for (auto _ : state) {
+ __asm__("nop");
+ }
+}
+BENCHMARK(BM_Treatment);
+
+BENCHMARK_MAIN();
diff --git a/roles/dotfiles/tasks/main.yml b/roles/dotfiles/tasks/main.yml
index 4def4d4..ba707a1 100644
--- a/roles/dotfiles/tasks/main.yml
+++ b/roles/dotfiles/tasks/main.yml
@@ -197,6 +197,12 @@
dest: '{{ homedir }}/.templates/template.cpp'
when: has_cpp.rc == 0
+ - name: Copy benchmark.cpp to home directory
+ ansible.builtin.copy:
+ src: misc/dotfiles/templates/benchmark.cpp
+ dest: '{{ homedir }}/.templates/benchmark.cpp'
+ when: has_cpp.rc == 0
+
- name: Copy template.py to home directory
ansible.builtin.copy:
src: misc/dotfiles/templates/template.py