Skip to content

Commit 6d824f1

Browse files
committed
Move benchmarks to cpp files
1 parent ddb20f1 commit 6d824f1

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

hpc_cpp.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@
77
// cl /Zi /EHsc /I google\x64-Release\include\ hpc_cpp.cpp benchmark.lib benchmark_main.lib /link /Machine:X64 /libpath:".\google\x64-Debug\lib" /out:hpc_cpp.exe
88

99
#include <benchmark/benchmark.h>
10-
#include "synchronization.h"
11-
12-
// Register the function as a benchmark
13-
BENCHMARK(BM_Add);
14-
BENCHMARK(BM_MutexAdd);
15-
BENCHMARK(BM_AtomicAdd);
1610

1711
// Run the benchmark
1812
BENCHMARK_MAIN();

hpc_cpp.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@
154154
</ItemDefinitionGroup>
155155
<ItemGroup>
156156
<ClCompile Include="hpc_cpp.cpp" />
157-
<ClCompile Include="synchronization.h" />
157+
<ClCompile Include="synchronization.cpp" />
158158
</ItemGroup>
159159
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
160160
<ImportGroup Label="ExtensionTargets">

synchronization.h renamed to synchronization.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,8 @@ static void BM_AtomicAdd(benchmark::State& state) {
3535

3636
benchmark::ClobberMemory();
3737
}
38+
39+
// Register the function as a benchmark
40+
BENCHMARK(BM_Add);
41+
BENCHMARK(BM_MutexAdd);
42+
BENCHMARK(BM_AtomicAdd);

0 commit comments

Comments
 (0)