@@ -26,7 +26,7 @@ struct Point3D {
26
26
return std::sqrt (x * x + y * y + z * z);
27
27
}
28
28
else if constexpr (name == " taxicab" ) {
29
- return abs (x) + abs (y) + abs (z);
29
+ return std:: abs (x) + std:: abs (y) + std:: abs (z);
30
30
}
31
31
else if constexpr (name == " chebyshev" ) {
32
32
return std::max (std::max (x, y), z);
@@ -98,13 +98,15 @@ static void simdobjsort(benchmark::State &state)
98
98
->Arg(10e5 ) \
99
99
->Arg(10e6 );
100
100
101
- BENCHMARK_OBJSORT (simdobjsort, Point3D, double , x)
102
- BENCHMARK_OBJSORT(scalarobjsort, Point3D, double , x)
103
- BENCHMARK_OBJSORT(simdobjsort, Point3D, float , x)
104
- BENCHMARK_OBJSORT(scalarobjsort, Point3D, float , x)
105
- BENCHMARK_OBJSORT(simdobjsort, Point3D, double , taxicab )
106
- BENCHMARK_OBJSORT(scalarobjsort, Point3D, double , taxicab)
107
- BENCHMARK_OBJSORT(simdobjsort, Point3D, double , euclidean)
108
- BENCHMARK_OBJSORT(scalarobjsort, Point3D, double , euclidean)
109
- BENCHMARK_OBJSORT(simdobjsort, Point3D, double , chebyshev)
110
- BENCHMARK_OBJSORT(scalarobjsort, Point3D, double , chebyshev)
101
+ #define BENCH_ALL (dtype ) \
102
+ BENCHMARK_OBJSORT (simdobjsort, Point3D, dtype, x) \
103
+ BENCHMARK_OBJSORT(scalarobjsort, Point3D, dtype, x) \
104
+ BENCHMARK_OBJSORT(simdobjsort, Point3D, dtype, taxicab ) \
105
+ BENCHMARK_OBJSORT(scalarobjsort, Point3D, dtype, taxicab) \
106
+ BENCHMARK_OBJSORT(simdobjsort, Point3D, dtype, euclidean) \
107
+ BENCHMARK_OBJSORT(scalarobjsort, Point3D, dtype, euclidean) \
108
+ BENCHMARK_OBJSORT(simdobjsort, Point3D, dtype, chebyshev) \
109
+ BENCHMARK_OBJSORT(scalarobjsort, Point3D, dtype, chebyshev) \
110
+
111
+ BENCH_ALL(double )
112
+ BENCH_ALL(float )
0 commit comments