I tried using the following 2 versions of my function:
template <typename T, typename U>
constexpr auto mult(T const& a, U const& b) {
return std::transform_reduce(a.begin(), a.end(), b.begin(), 0.);
//return std::transform_reduce(std::execution::par, a.begin(), a.end(), b.begin(), 0.);
}
I am calling this function with 2 std::arrays The second version (commented out above) runs ~40x slower than the first one. I am using VS2019 (16.3.1), compiling on Release.