Skip to content

Commit

Permalink
Clean up benches so they work again
Browse files Browse the repository at this point in the history
  • Loading branch information
jtlap authored Apr 22, 2024
1 parent 3f95018 commit eb82b67
Show file tree
Hide file tree
Showing 111 changed files with 502 additions and 364 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ int main()
auto lmax = EVE_VALUE(10);

auto arg0 = eve::bench::random_<EVE_VALUE>(lmin,lmax);
// auto stdj1 = [](auto x){return std::cyl_bessel_j(0, x);};
auto stdj1 = [](auto x){return std::cyl_bessel_j(1, x);};
auto boostj1= [](auto x){return boost::math::detail::bessel_j1(x);};
eve::bench::experiment xp;
run<EVE_TYPE> (EVE_NAME(cyl_bessel_j1) , xp, eve::cyl_bessel_j1 , arg0);
run<EVE_VALUE>(EVE_NAME(cyl_bessel_j1) , xp, eve::cyl_bessel_j1 , arg0);
// run<EVE_VALUE>(EVE_NAME(stdj1) , xp, stdj1 , arg0);
run<EVE_VALUE>(EVE_NAME(stdj1) , xp, stdj1 , arg0);
run<EVE_VALUE>(EVE_NAME(boostj1), xp, boostj1 , arg0);
}
10 changes: 2 additions & 8 deletions benchmarks/module/combinatorial/gcd/regular/gcd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,8 @@

int main()
{
auto lmin = 1; //eve::valmin(eve::as<EVE_VALUE>());
auto lmax = 100; //eve::valmax(eve::as<EVE_VALUE>());
// if constexpr(std::is_floating_point_v<EVE_VALUE>)
// {
// lmin = -100000;
// lmax = 100000;
// }

auto lmin = 1;
auto lmax = 100;

auto arg0 = eve::bench::random_<EVE_VALUE>(lmin,lmax);
auto arg1 = eve::bench::random_<EVE_VALUE>(lmin,lmax);
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/module/core/arg/pedantic/arg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ int main()
auto arg0 = eve::bench::random_<EVE_VALUE>(lmin,lmax);

eve::bench::experiment xp;
run<EVE_VALUE> (EVE_NAME(pedantic(eve::arg)) , xp, eve::pedantic(eve::arg), arg0);
run<EVE_TYPE> (EVE_NAME(pedantic(eve::arg)) , xp, eve::pedantic(eve::arg), arg0);
run<EVE_VALUE> (EVE_NAME(arg[eve::pedantic2]) , xp, eve::arg[eve::pedantic2], arg0);
run<EVE_TYPE> (EVE_NAME(arg[eve::pedantic2]) , xp, eve::arg[eve::pedantic2], arg0);
}
1 change: 1 addition & 0 deletions benchmarks/module/core/bit_cast/regular/bit_cast.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

int main()
{
//TODO
// auto lmin = eve::valmin(eve::as<EVE_VALUE>());
// auto lmax = eve::valmax(eve::as<EVE_VALUE>());

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/module/core/dec/regular/dec.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ int main()
auto lmin = eve::valmin(eve::as<EVE_VALUE>());
auto lmax = eve::valmax(eve::as<EVE_VALUE>());

auto const std__dec = [](EVE_VALUE x) { return x > 0 ? x : EVE_VALUE(-x); };
auto const std__dec = [](EVE_VALUE x) { return x > 0 ? x : EVE_VALUE(x)-EVE_VALUE(1); };

auto arg0 = eve::bench::random_<EVE_VALUE>(lmin,lmax);

Expand Down
4 changes: 2 additions & 2 deletions benchmarks/module/core/dec/saturated/dec.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ int main()
auto arg0 = eve::bench::random_<EVE_VALUE>(lmin,lmax);

eve::bench::experiment xp;
run<EVE_VALUE> (EVE_NAME(saturated(eve::dec)) , xp, eve::saturated(eve::dec), arg0);
run<EVE_TYPE> (EVE_NAME(saturated(eve::dec)) , xp, eve::saturated(eve::dec), arg0);
run<EVE_VALUE> (EVE_NAME(saturated(eve::dec)) , xp, eve::dec[eve::saturated2], arg0);
run<EVE_TYPE> (EVE_NAME(saturated(eve::dec)) , xp, eve::dec[eve::saturated2], arg0);
}
2 changes: 1 addition & 1 deletion benchmarks/module/core/dec/saturated_if/dec.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ int main()
auto arg0 = eve::bench::random_<L_VALUE>(0, 1);
auto arg1 = eve::bench::random_<EVE_VALUE>(lmin,lmax);

auto eve__dec = [](auto x, auto y){ return eve::saturated(eve::dec[x])(y); };
auto eve__dec = [](auto x, auto y){ return eve::dec[x][eve::saturated2](y); };
eve::bench::experiment xp;
run<eve::bench::types<L_VALUE, EVE_VALUE>> (EVE_NAME(eve__dec) , xp, eve__dec, arg0, arg1);
run<eve::bench::types<L_TYPE, EVE_TYPE>> (EVE_NAME(eve__dec) , xp, eve__dec, arg0, arg1);
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/module/core/dist/saturated/dist.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ int main()
auto arg1 = eve::bench::random_<EVE_VALUE>(lmin,lmax);

eve::bench::experiment xp;
run<EVE_VALUE>(EVE_NAME(dist) , xp, eve::saturated(eve::dist), arg0, arg1);
run<EVE_TYPE> (EVE_NAME(dist) , xp, eve::saturated(eve::dist), arg0, arg1);
run<EVE_VALUE>(EVE_NAME(dist) , xp, eve::dist[eve::saturated2], arg0, arg1);
run<EVE_TYPE> (EVE_NAME(dist) , xp, eve::dist[eve::saturated2], arg0, arg1);
}
4 changes: 2 additions & 2 deletions benchmarks/module/core/div/regular/div.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
//==================================================================================================
#include <eve/module/core.hpp>
#include <eve/concept/value.hpp>
#include <eve/module/math/constant/oneotwoeps.hpp>
#include <eve/module/core/constant/eps.hpp>
#include <cmath>

int main()
{
auto lmin = eve::valmin(eve::as<EVE_VALUE>());
auto lmax = [](){
if constexpr(eve::floating_value<EVE_VALUE>) return eve::oneotwoeps(eve::as<EVE_VALUE>());
if constexpr(eve::floating_value<EVE_VALUE>) return 1/eve::eps(eve::as<EVE_VALUE>());
else return eve::valmax(eve::as<EVE_VALUE>());
}();

Expand Down
26 changes: 0 additions & 26 deletions benchmarks/module/core/fma/numeric/fma.hpp

This file was deleted.

26 changes: 0 additions & 26 deletions benchmarks/module/core/fms/numeric/fms.hpp

This file was deleted.

4 changes: 2 additions & 2 deletions benchmarks/module/core/fms/pedantic/fms.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ int main()

eve::bench::experiment xp;
run<EVE_VALUE>(EVE_NAME(std__fms) , xp, std__fms, arg0, arg1, arg2);
run<EVE_VALUE>(EVE_NAME(pedantic(eve::fms)) , xp, eve::pedantic(eve::fms), arg0, arg1, arg2);
run<EVE_TYPE> (EVE_NAME(pedantic(eve::fms)) , xp, eve::pedantic(eve::fms), arg0, arg1, arg2);
run<EVE_VALUE>(EVE_NAME(fms[eve::pedantic2]) , xp, eve::fms[eve::pedantic2], arg0, arg1, arg2);
run<EVE_TYPE> (EVE_NAME(fms[eve::pedantic2]) , xp, eve::fms[eve::pedantic2], arg0, arg1, arg2);
}
26 changes: 0 additions & 26 deletions benchmarks/module/core/fnma/numeric/fnma.hpp

This file was deleted.

4 changes: 2 additions & 2 deletions benchmarks/module/core/fnma/pedantic/fnma.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ int main()

eve::bench::experiment xp;
run<EVE_VALUE>(EVE_NAME(std__fnma) , xp, std__fnma, arg0, arg1, arg2);
run<EVE_VALUE>(EVE_NAME(pedantic(eve::fnma)) , xp, eve::pedantic(eve::fnma), arg0, arg1, arg2);
run<EVE_TYPE> (EVE_NAME(pedantic(eve::fnma)) , xp, eve::pedantic(eve::fnma), arg0, arg1, arg2);
run<EVE_VALUE>(EVE_NAME(fnma[eve::pedantic2]) , xp, eve::fnma[eve::pedantic2], arg0, arg1, arg2);
run<EVE_TYPE> (EVE_NAME(fnma[eve::pedantic2]) , xp, eve::fnma[eve::pedantic2], arg0, arg1, arg2);
}
26 changes: 0 additions & 26 deletions benchmarks/module/core/fnms/numeric/fnms.hpp

This file was deleted.

4 changes: 2 additions & 2 deletions benchmarks/module/core/fnms/pedantic/fnms.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ int main()

eve::bench::experiment xp;
run<EVE_VALUE>(EVE_NAME(std__fnms) , xp, std__fnms, arg0, arg1, arg2);
run<EVE_VALUE>(EVE_NAME(pedantic(eve::fnms)) , xp, eve::pedantic(eve::fnms), arg0, arg1, arg2);
run<EVE_TYPE> (EVE_NAME(pedantic(eve::fnms)) , xp, eve::pedantic(eve::fnms), arg0, arg1, arg2);
run<EVE_VALUE>(EVE_NAME(fnms[eve::pedantic2]) , xp, eve::fnms[eve::pedantic2], arg0, arg1, arg2);
run<EVE_TYPE> (EVE_NAME(fnms[eve::pedantic2]) , xp, eve::fnms[eve::pedantic2], arg0, arg1, arg2);
}
4 changes: 2 additions & 2 deletions benchmarks/module/core/frexp/pedantic/frexp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ int main()
auto arg0 = eve::bench::random_<EVE_VALUE>(lmin,lmax);

eve::bench::experiment xp;
run<EVE_VALUE> (EVE_NAME(pedantic(eve::frexp)) , xp, eve::pedantic(eve::frexp), arg0);
run<EVE_TYPE> (EVE_NAME(pedantic(eve::frexp)) , xp, eve::pedantic(eve::frexp), arg0);
run<EVE_VALUE> (EVE_NAME(frexp[eve::pedantic2]) , xp, eve::frexp[eve::pedantic2], arg0);
run<EVE_TYPE> (EVE_NAME(frexp[eve::pedantic2]) , xp, eve::frexp[eve::pedantic2], arg0);
}
4 changes: 2 additions & 2 deletions benchmarks/module/core/frexp/raw/frexp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ int main()
auto arg0 = eve::bench::random_<EVE_VALUE>(lmin,lmax);
eve::bench::experiment xp;

run<EVE_VALUE> (EVE_NAME(raw(eve::frexp)) , xp, eve::raw(eve::frexp), arg0);
run<EVE_TYPE> (EVE_NAME(raw(eve::frexp)) , xp, eve::raw(eve::frexp), arg0);
run<EVE_VALUE> (EVE_NAME(frexp[eve::raw2]) , xp, eve::frexp[eve::raw2], arg0);
run<EVE_TYPE> (EVE_NAME(frexp[eve::raw2]) , xp, eve::frexp[eve::raw2], arg0);
}
4 changes: 2 additions & 2 deletions benchmarks/module/core/ifrexp/pedantic/ifrexp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ int main()
auto arg0 = eve::bench::random_<EVE_VALUE>(lmin,lmax);

eve::bench::experiment xp;
run<EVE_VALUE> (EVE_NAME(pedantic(eve::ifrexp)) , xp, eve::pedantic(eve::ifrexp), arg0);
run<EVE_TYPE> (EVE_NAME(pedantic(eve::ifrexp)) , xp, eve::pedantic(eve::ifrexp), arg0);
run<EVE_VALUE> (EVE_NAME(ifrexp[eve::pedantic2]) , xp, eve::ifrexp[eve::pedantic2], arg0);
run<EVE_TYPE> (EVE_NAME(ifrexp[eve::pedantic2]) , xp, eve::ifrexp[eve::pedantic2], arg0);
}
4 changes: 2 additions & 2 deletions benchmarks/module/core/ifrexp/raw/ifrexp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ int main()
auto arg0 = eve::bench::random_<EVE_VALUE>(lmin,lmax);
eve::bench::experiment xp;

run<EVE_VALUE> (EVE_NAME(raw(eve::ifrexp)) , xp, eve::raw(eve::ifrexp), arg0);
run<EVE_TYPE> (EVE_NAME(raw(eve::ifrexp)) , xp, eve::raw(eve::ifrexp), arg0);
run<EVE_VALUE> (EVE_NAME(ifrexp[eve::raw2]) , xp, eve::ifrexp[eve::raw2], arg0);
run<EVE_TYPE> (EVE_NAME(ifrexp[eve::raw2]) , xp, eve::ifrexp[eve::raw2], arg0);
}
4 changes: 2 additions & 2 deletions benchmarks/module/core/inc/saturated/inc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ int main()
auto arg0 = eve::bench::random_<EVE_VALUE>(lmin,lmax);

eve::bench::experiment xp;
run<EVE_VALUE> (EVE_NAME(saturated(eve::inc)) , xp, eve::saturated(eve::inc), arg0);
run<EVE_TYPE> (EVE_NAME(saturated(eve::inc)) , xp, eve::saturated(eve::inc), arg0);
run<EVE_VALUE> (EVE_NAME(saturated(eve::inc)) , xp, eve::inc[eve::saturated2], arg0);
run<EVE_TYPE> (EVE_NAME(saturated(eve::inc)) , xp, eve::inc[eve::saturated2], arg0);
}
2 changes: 1 addition & 1 deletion benchmarks/module/core/inc/saturated_if/inc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ int main()
auto arg0 = eve::bench::random_<L_VALUE>(0, 1);
auto arg1 = eve::bench::random_<EVE_VALUE>(lmin,lmax);

auto eve__inc = [](auto x, auto y){ return eve::saturated(eve::inc[x])(y); };
auto eve__inc = [](auto x, auto y){ return eve::inc[x][eve::saturated2](y); };
eve::bench::experiment xp;
run<eve::bench::types<L_VALUE, EVE_VALUE>> (EVE_NAME(eve__inc) , xp, eve__inc, arg0, arg1);
run<eve::bench::types<L_TYPE, EVE_TYPE>> (EVE_NAME(eve__inc) , xp, eve__inc, arg0, arg1);
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/module/core/is_flint/pedantic/is_flint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ int main()

eve::bench::experiment xp;
run<EVE_VALUE> (EVE_NAME(std__is_flint) , xp, std__is_flint, arg0);
run<EVE_VALUE> (EVE_NAME(pedantic(eve::is_flint)) , xp, eve::pedantic(eve::is_flint), arg0);
run<EVE_TYPE> (EVE_NAME(pedantic(eve::is_flint)) , xp, eve::pedantic(eve::is_flint), arg0);
run<EVE_VALUE> (EVE_NAME(is_flint[eve::pedantic2]) , xp, eve::is_flint[eve::pedantic2], arg0);
run<EVE_TYPE> (EVE_NAME(is_flint[eve::pedantic2]) , xp, eve::is_flint[eve::pedantic2], arg0);
}
6 changes: 3 additions & 3 deletions benchmarks/module/core/ldexp/pedantic/ldexp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ int main()

eve::bench::experiment xp;
run<eve::bench::types<EVE_VALUE, I_VALUE>>(EVE_NAME(std__ldexp) , xp, std__ldexp, arg0, arg1);
run<eve::bench::types<EVE_VALUE, I_VALUE>>(EVE_NAME(eve::pedantic(eve::ldexp)) , xp, eve::pedantic(eve::ldexp), arg0, arg1);
run<eve::bench::types<EVE_TYPE, I_VALUE>> (EVE_NAME(eve::pedantic(eve::ldexp)) , xp, eve::pedantic(eve::ldexp), arg0, arg1);
run<eve::bench::types<EVE_TYPE, I_TYPE>> (EVE_NAME(eve::pedantic(eve::ldexp)) , xp, eve::pedantic(eve::ldexp), arg0, arg1);
run<eve::bench::types<EVE_VALUE, I_VALUE>>(EVE_NAME(eve::ldexp[eve::pedantic2]) , xp, eve::ldexp[eve::pedantic2], arg0, arg1);
run<eve::bench::types<EVE_TYPE, I_VALUE>> (EVE_NAME(eve::ldexp[eve::pedantic2]) , xp, eve::ldexp[eve::pedantic2], arg0, arg1);
run<eve::bench::types<EVE_TYPE, I_TYPE>> (EVE_NAME(eve::ldexp[eve::pedantic2]) , xp, eve::ldexp[eve::pedantic2], arg0, arg1);


}
20 changes: 12 additions & 8 deletions benchmarks/module/core/logical_not/regular/logical_not.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,19 @@

int main()
{
auto lmin = eve::valmin(eve::as<EVE_VALUE>());
auto lmax = eve::valmax(eve::as<EVE_VALUE>());
// TODO
// auto lmin = eve::valmin(eve::as<EVE_VALUE>());
// auto lmax = eve::valmax(eve::as<EVE_VALUE>());

auto arg0 = eve::bench::random_<EVE_VALUE>(lmin,lmax);
// auto arg0 = eve::bench::random_<EVE_VALUE>(lmin,lmax);

eve::bench::experiment xp;
auto const std__logical_not = [](auto x) { return EVE_VALUE(!x); };
run<EVE_VALUE> (EVE_NAME(std__logical_not) , xp, std__logical_not, arg0);
// eve::bench::experiment xp;
// if constexpr(eve::integral_value<EVE_VALUE>)
// {
// auto const std__logical_not = [](auto x) { return EVE_VALUE(!x); };
// run<EVE_VALUE> (EVE_NAME(std__logical_not) , xp, std__logical_not, arg0);

run<EVE_VALUE> (EVE_NAME(logical_not) , xp, eve::logical_not, arg0);
run<EVE_TYPE> (EVE_NAME(logical_not) , xp, eve::logical_not, arg0);
// run<EVE_VALUE> (EVE_NAME(logical_not) , xp, eve::logical_not, arg0);
// run<EVE_TYPE> (EVE_NAME(logical_not) , xp, eve::logical_not, arg0);
// }
}
21 changes: 11 additions & 10 deletions benchmarks/module/core/lookup/regular/lookup.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,19 @@

int main()
{
using I_VALUE = eve::as_integer_t<EVE_VALUE>;
using I_TYPE = eve::as_integer_t<EVE_TYPE>;
auto lmin = eve::valmin(eve::as<EVE_VALUE>());
auto lmax = eve::valmax(eve::as<EVE_VALUE>());
auto smin = I_VALUE(0);
auto smax = I_VALUE(sizeof(EVE_VALUE)-1);
//TODO
// using I_VALUE = eve::as_integer_t<EVE_VALUE>;
// using I_TYPE = eve::as_integer_t<EVE_TYPE>;
// auto lmin = eve::valmin(eve::as<EVE_VALUE>());
// auto lmax = eve::valmax(eve::as<EVE_VALUE>());
// auto smin = I_VALUE(0);
// auto smax = I_VALUE(sizeof(EVE_VALUE)-1);

auto arg0 = eve::bench::random_<EVE_VALUE>(lmin,lmax);
auto arg1 = eve::bench::random_<I_VALUE>(smin,smax);
// auto arg0 = eve::bench::random_<EVE_VALUE>(lmin,lmax);
// auto arg1 = eve::bench::random_<I_VALUE>(smin,smax);

eve::bench::experiment xp;
run<eve::bench::types<EVE_TYPE, I_TYPE>> (EVE_NAME(lookup) , xp, eve::lookup, arg0, arg1);
// eve::bench::experiment xp;
// run<eve::bench::types<EVE_TYPE, I_TYPE>> (EVE_NAME(lookup) , xp, eve::lookup, arg0, arg1);


}
4 changes: 2 additions & 2 deletions benchmarks/module/core/manhattan/pedantic/manhattan.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ int main()
auto arg1 = eve::bench::random_<EVE_VALUE>(lmin,lmax);

eve::bench::experiment xp;
run<EVE_VALUE>(EVE_NAME(pedantic(eve::manhattan)) , xp, eve::pedantic(eve::manhattan), arg0, arg1);
run<EVE_TYPE> (EVE_NAME(pedantic(eve::manhattan)) , xp, eve::pedantic(eve::manhattan), arg0, arg1);
run<EVE_VALUE>(EVE_NAME(manhattan[eve::pedantic2]) , xp, eve::manhattan[eve::pedantic2], arg0, arg1);
run<EVE_TYPE> (EVE_NAME(manhattan[eve::pedantic2]) , xp, eve::manhattan[eve::pedantic2], arg0, arg1);
}
4 changes: 2 additions & 2 deletions benchmarks/module/core/max/numeric/max.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ int main()

eve::bench::experiment xp;
run<EVE_VALUE>(EVE_NAME(std__max) , xp, std__max, arg0, arg1);
run<EVE_VALUE>(EVE_NAME(numeric(eve::max)) , xp, eve::numeric(eve::max), arg0, arg1);
run<EVE_TYPE> (EVE_NAME(numeric(eve::max)) , xp, eve::numeric(eve::max), arg0, arg1);
run<EVE_VALUE>(EVE_NAME(max[eve::numeric2]) , xp, eve::max[eve::numeric2], arg0, arg1);
run<EVE_TYPE> (EVE_NAME(max[eve::numeric2]) , xp, eve::max[eve::numeric2], arg0, arg1);
}
4 changes: 2 additions & 2 deletions benchmarks/module/core/max/pedantic/max.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ int main()

eve::bench::experiment xp;
run<EVE_VALUE>(EVE_NAME(std__max) , xp, std__max, arg0, arg1);
run<EVE_VALUE>(EVE_NAME(pedantic(eve::max)) , xp, eve::pedantic(eve::max), arg0, arg1);
run<EVE_TYPE> (EVE_NAME(pedantic(eve::max)) , xp, eve::pedantic(eve::max), arg0, arg1);
run<EVE_VALUE>(EVE_NAME(max[eve::pedantic2]) , xp, eve::max[eve::pedantic2], arg0, arg1);
run<EVE_TYPE> (EVE_NAME(max[eve::pedantic2]) , xp, eve::max[eve::pedantic2], arg0, arg1);
}
Loading

0 comments on commit eb82b67

Please sign in to comment.