2015-02-10 14:02:38 -08:00
|
|
|
// This file is part of Eigen, a lightweight C++ template library
|
|
|
|
|
// for linear algebra.
|
|
|
|
|
//
|
|
|
|
|
// This Source Code Form is subject to the terms of the Mozilla
|
|
|
|
|
// Public License v. 2.0. If a copy of the MPL was not distributed
|
|
|
|
|
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
|
|
|
|
|
|
#ifndef EIGEN_MATH_FUNCTIONS_NEON_H
|
|
|
|
|
#define EIGEN_MATH_FUNCTIONS_NEON_H
|
|
|
|
|
|
|
|
|
|
namespace Eigen {
|
|
|
|
|
|
|
|
|
|
namespace internal {
|
|
|
|
|
|
2019-11-26 18:31:22 +00:00
|
|
|
template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet2f pexp<Packet2f>(const Packet2f& x)
|
|
|
|
|
{ return pexp_float(x); }
|
2020-01-10 18:31:15 +00:00
|
|
|
template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet4f pexp<Packet4f>(const Packet4f& x)
|
|
|
|
|
{ return pexp_float(x); }
|
|
|
|
|
|
2019-11-26 18:31:22 +00:00
|
|
|
template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet2f plog<Packet2f>(const Packet2f& x)
|
|
|
|
|
{ return plog_float(x); }
|
2020-01-10 18:31:15 +00:00
|
|
|
template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet4f plog<Packet4f>(const Packet4f& x)
|
|
|
|
|
{ return plog_float(x); }
|
|
|
|
|
|
2019-11-26 18:31:22 +00:00
|
|
|
template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet2f psin<Packet2f>(const Packet2f& x)
|
|
|
|
|
{ return psin_float(x); }
|
2020-01-10 18:31:15 +00:00
|
|
|
template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet4f psin<Packet4f>(const Packet4f& x)
|
|
|
|
|
{ return psin_float(x); }
|
|
|
|
|
|
2019-11-26 18:31:22 +00:00
|
|
|
template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet2f pcos<Packet2f>(const Packet2f& x)
|
|
|
|
|
{ return pcos_float(x); }
|
2020-01-10 18:31:15 +00:00
|
|
|
template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet4f pcos<Packet4f>(const Packet4f& x)
|
|
|
|
|
{ return pcos_float(x); }
|
2017-10-23 13:22:22 +00:00
|
|
|
|
2019-09-19 12:48:30 -07:00
|
|
|
// Hyperbolic Tangent function.
|
2019-11-26 18:31:22 +00:00
|
|
|
template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet2f ptanh<Packet2f>(const Packet2f& x)
|
|
|
|
|
{ return internal::generic_fast_tanh_float(x); }
|
2020-01-10 18:31:15 +00:00
|
|
|
template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet4f ptanh<Packet4f>(const Packet4f& x)
|
|
|
|
|
{ return internal::generic_fast_tanh_float(x); }
|
2019-09-19 12:48:30 -07:00
|
|
|
|
2020-08-13 15:48:40 +00:00
|
|
|
BF16_PACKET_FUNCTION(Packet4f, Packet4bf, psin)
|
|
|
|
|
BF16_PACKET_FUNCTION(Packet4f, Packet4bf, pcos)
|
|
|
|
|
BF16_PACKET_FUNCTION(Packet4f, Packet4bf, plog)
|
|
|
|
|
BF16_PACKET_FUNCTION(Packet4f, Packet4bf, pexp)
|
|
|
|
|
BF16_PACKET_FUNCTION(Packet4f, Packet4bf, ptanh)
|
|
|
|
|
|
2020-09-08 09:04:03 +00:00
|
|
|
|
|
|
|
|
//---------- double ----------
|
|
|
|
|
|
|
|
|
|
#if EIGEN_ARCH_ARM64 && !EIGEN_APPLE_DOUBLE_NEON_BUG
|
|
|
|
|
template<> EIGEN_DEFINE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS EIGEN_UNUSED Packet2d pexp<Packet2d>(const Packet2d& x)
|
|
|
|
|
{ return pexp_double(x); }
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
2015-02-10 14:02:38 -08:00
|
|
|
} // end namespace internal
|
|
|
|
|
|
|
|
|
|
} // end namespace Eigen
|
|
|
|
|
|
|
|
|
|
#endif // EIGEN_MATH_FUNCTIONS_NEON_H
|