0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-25 15:04:10 +01:00

ircd::math: Additional fallback overloads for explicit precisions.

This commit is contained in:
Jason Volk 2021-03-16 13:31:53 -07:00
parent 74d7747fa3
commit 480722b3b8
4 changed files with 87 additions and 7 deletions

View file

@ -18,10 +18,3 @@
#include "pow.h"
#include "fmma.h"
#include "norm.h"
namespace ircd
{
using math::mean;
using math::tanh;
using math::pow;
}

View file

@ -24,6 +24,11 @@ namespace ircd::math
mean(const vector_view<const T>);
}
namespace ircd
{
using math::mean;
}
template<class T,
class R>
inline typename std::enable_if<ircd::simd::is<T>(), ircd::simd::lane_type<R>>::type

View file

@ -17,6 +17,50 @@ namespace ircd::math
class E>
typename std::enable_if<simd::is<T>(), T>::type
pow(T, const E);
template<class T,
class E>
typename std::enable_if<simd::is<T>(), T>::type
powf(T, const E);
template<class T,
class E>
typename std::enable_if<simd::is<T>(), T>::type
powl(T, const E);
}
namespace ircd
{
using ::pow;
using ::powf;
using ::powl;
using math::pow;
using math::powf;
using math::powl;
}
template<class T,
class E>
inline typename std::enable_if<ircd::simd::is<T>(), T>::type
ircd::math::powl(T a,
const E e)
{
for(uint i(0); i < simd::lanes<T>(); ++i)
a[i] = ::powl(a[i], e);
return a;
}
template<class T,
class E>
inline typename std::enable_if<ircd::simd::is<T>(), T>::type
ircd::math::powf(T a,
const E e)
{
for(uint i(0); i < simd::lanes<T>(); ++i)
a[i] = ::powf(a[i], e);
return a;
}
template<class T,

View file

@ -16,6 +16,44 @@ namespace ircd::math
template<class T>
typename std::enable_if<simd::is<T>(), T>::type
tanh(T);
template<class T>
typename std::enable_if<simd::is<T>(), T>::type
tanhf(T);
template<class T>
typename std::enable_if<simd::is<T>(), T>::type
tanhl(T);
}
namespace ircd
{
using ::tanh;
using ::tanhf;
using ::tanhl;
using math::tanh;
using math::tanhf;
using math::tanhl;
}
template<class T>
inline typename std::enable_if<ircd::simd::is<T>(), T>::type
ircd::math::tanhl(T a)
{
for(uint i(0); i < simd::lanes<T>(); ++i)
a[i] = ::tanhl(a[i]);
return a;
}
template<class T>
inline typename std::enable_if<ircd::simd::is<T>(), T>::type
ircd::math::tanhf(T a)
{
for(uint i(0); i < simd::lanes<T>(); ++i)
a[i] = ::tanhf(a[i]);
return a;
}
template<class T>