@@ -48,8 +48,8 @@ Vec4 result;
4848 * @return The average duration per call in nanoseconds.
4949 */
5050[[nodiscard, clang::noinline]] std::chrono::nanoseconds Benchmark (
51- Vec4& position, Mat4& translation,
52- std::function<Vec4(const Vec4&, const Mat4&)> func) {
51+ Vec4<> & position, Mat4<> & translation,
52+ std::function<Vec4<> (const Vec4<> &, const Mat4<> &)> func) {
5353 // TODO: Move to a unit test.
5454 auto test = func (position, translation);
5555 auto expected = Vec4{{20 , 10 , 10 , 1 }};
@@ -82,11 +82,11 @@ BenchmarkMatrixMultiplication(Backend backend) {
8282 switch (backend) {
8383 case Backend::kAutoVectorization :
8484 LOG (INFO) << " Benchmarking auto-vectorization" ;
85- return Benchmark (position, translation, [](Vec4 p, Mat4 t) {
85+ return Benchmark (position, translation, [](Vec4<> p, Mat4<> t) {
8686 return MultiplyWithAutoVectorization (t, p);
8787 });
8888 case Backend::kCxxSimd :
89- #if __NDK_MAJOR__ >= 28
89+ #if __NDK_MAJOR__ >= 29
9090#error check if std::simd works yet
9191#endif
9292 // The libc++ in NDK r27 has only a skeleton implementation of std::simd.
@@ -96,19 +96,20 @@ BenchmarkMatrixMultiplication(Backend backend) {
9696 return std::unexpected{BenchmarkError::kNotImplemented };
9797 case Backend::kClangVector :
9898 LOG (INFO) << " Benchmarking Clang vectors" ;
99- return Benchmark (position, translation, [](Vec4 p, Mat4 t) {
99+ return Benchmark (position, translation, [](Vec4<> p, Mat4<> t) {
100100 return MultiplyWithClangVectors (t, p);
101101 });
102102 case Backend::kClangMatrix :
103103 LOG (INFO) << " Benchmarking Clang matrices" ;
104- return Benchmark (position, translation, [](Vec4 p, Mat4 t) {
104+ return Benchmark (position, translation, [](Vec4<> p, Mat4<> t) {
105105 // This is the default implementation since it's the fastest.
106106 return t * p;
107107 });
108108 case Backend::kOpenMp :
109109 LOG (INFO) << " Benchmarking OpenMP SIMD" ;
110- return Benchmark (position, translation,
111- [](Vec4 p, Mat4 t) { return MultiplyWithOpenMP (t, p); });
110+ return Benchmark (position, translation, [](Vec4<> p, Mat4<> t) {
111+ return MultiplyWithOpenMP (t, p);
112+ });
112113 default :
113114 return std::unexpected{BenchmarkError::kUnknownBackend };
114115 }
0 commit comments