diff --git a/benchmarks/array/include/benchmark/array/data_generator.hpp b/benchmarks/array/include/benchmark/array/data_generator.hpp index b4bf5939..bfbfd847 100644 --- a/benchmarks/array/include/benchmark/array/data_generator.hpp +++ b/benchmarks/array/include/benchmark/array/data_generator.hpp @@ -9,6 +9,7 @@ // Project include(s) #include "algebra/array_cmath.hpp" +#include "algebra/concepts.hpp" // System include(s) #include @@ -18,7 +19,7 @@ namespace algebra { /// Fill an @c std::array based vector with random values -template +template inline void fill_random_vec(std::vector &collection) { // Generate a vector of the right type with random values @@ -33,7 +34,7 @@ inline void fill_random_vec(std::vector &collection) { } /// Fill a @c std::array based transform3 with random values -template +template inline void fill_random_trf(std::vector &collection) { using vector_t = typename transform3_t::vector3; @@ -64,7 +65,7 @@ inline void fill_random_trf(std::vector &collection) { } /// Fill a @c std::array based matrix with random values -template +template inline void fill_random_matrix(std::vector &collection) { using scalar_t = typename matrix_t::value_type::value_type; diff --git a/benchmarks/common/include/benchmark/common/benchmark_matrix.hpp b/benchmarks/common/include/benchmark/common/benchmark_matrix.hpp index e17ce107..a99ef315 100644 --- a/benchmarks/common/include/benchmark/common/benchmark_matrix.hpp +++ b/benchmarks/common/include/benchmark/common/benchmark_matrix.hpp @@ -17,14 +17,14 @@ namespace algebra { -template +template void fill_random_matrix(std::vector&); -template +template void fill_random_vec(std::vector&); /// Benchmark for matrix operations -template +template struct matrix_bm : public benchmark_base { /// Prefix for the benchmark name @@ -59,8 +59,9 @@ struct matrix_bm : public benchmark_base { }; /// Benchmark operations on a single matrix (transpose, inverse etc) -template -struct matrix_unaryOP_bm : public matrix_bm { +template +requires std::invocable struct matrix_unaryOP_bm + : public matrix_bm { using base_type = matrix_bm; matrix_unaryOP_bm() = delete; @@ -90,8 +91,9 @@ struct matrix_unaryOP_bm : public matrix_bm { }; /// Benchmark elementwise addition/subtraction/multiplication of matrices -template -struct matrix_binaryOP_bm : public matrix_bm { +template +requires std::invocable struct matrix_binaryOP_bm + : public matrix_bm { using base_type = matrix_bm; matrix_binaryOP_bm() = delete; @@ -121,7 +123,7 @@ struct matrix_binaryOP_bm : public matrix_bm { }; /// Benchmark matrix vector multiplication -template +template struct matrix_vector_bm : public matrix_bm { using base_type = matrix_bm; @@ -162,21 +164,21 @@ namespace bench_op { struct add { inline static const std::string name{"add"}; - template + template matrix_t operator()(const matrix_t& a, const matrix_t& b) const { return a + b; } }; struct sub { inline static const std::string name{"sub"}; - template + template matrix_t operator()(const matrix_t& a, const matrix_t& b) const { return a - b; } }; struct mul { inline static const std::string name{"mul"}; - template + template matrix_t operator()(const matrix_t& a, const matrix_t& b) const { return a * b; } @@ -184,7 +186,7 @@ struct mul { struct transpose { inline static const std::string name{"transpose"}; - template + template auto operator()(const matrix_t& a) const { return algebra::matrix::transpose(a); } diff --git a/benchmarks/common/include/benchmark/common/benchmark_transform3.hpp b/benchmarks/common/include/benchmark/common/benchmark_transform3.hpp index 1c0e84d3..0442b987 100644 --- a/benchmarks/common/include/benchmark/common/benchmark_transform3.hpp +++ b/benchmarks/common/include/benchmark/common/benchmark_transform3.hpp @@ -19,11 +19,11 @@ namespace algebra { -template +template void fill_random_trf(std::vector&); /// Benchmark for vector operations -template +template struct transform3_bm : public vector_bm { private: using base_type = vector_bm; diff --git a/benchmarks/common/include/benchmark/common/benchmark_vector.hpp b/benchmarks/common/include/benchmark/common/benchmark_vector.hpp index 9d672055..a49f3a1c 100644 --- a/benchmarks/common/include/benchmark/common/benchmark_vector.hpp +++ b/benchmarks/common/include/benchmark/common/benchmark_vector.hpp @@ -20,11 +20,11 @@ namespace algebra { -template +template void fill_random_vec(std::vector &); /// Benchmark for vector operations -template +template struct vector_bm : public benchmark_base { /// Prefix for the benchmark name @@ -57,9 +57,10 @@ struct vector_bm : public benchmark_base { }; /// Benchmark elementwise addition of vectors -template