mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
merge Tensor module within Eigen/unsupported and update gemv BLAS wrapper
This commit is contained in:
@@ -47,8 +47,8 @@
|
||||
// protected by parenthesis against macro expansion, the min()/max() macros
|
||||
// are defined here and any not-parenthesized min/max call will cause a
|
||||
// compiler error.
|
||||
#define min(A,B) please_protect_your_min_with_parentheses
|
||||
#define max(A,B) please_protect_your_max_with_parentheses
|
||||
//#define min(A,B) please_protect_your_min_with_parentheses
|
||||
//#define max(A,B) please_protect_your_max_with_parentheses
|
||||
|
||||
#define FORBIDDEN_IDENTIFIER (this_identifier_is_forbidden_to_avoid_clashes) this_identifier_is_forbidden_to_avoid_clashes
|
||||
// B0 is defined in POSIX header termios.h
|
||||
@@ -237,6 +237,7 @@ inline void verify_impl(bool condition, const char *testname, const char *file,
|
||||
#define VERIFY(a) ::verify_impl(a, g_test_stack.back().c_str(), __FILE__, __LINE__, EI_PP_MAKE_STRING(a))
|
||||
|
||||
#define VERIFY_IS_EQUAL(a, b) VERIFY(test_is_equal(a, b))
|
||||
#define VERIFY_IS_NOT_EQUAL(a, b) VERIFY(!test_is_equal(a, b))
|
||||
#define VERIFY_IS_APPROX(a, b) VERIFY(test_isApprox(a, b))
|
||||
#define VERIFY_IS_NOT_APPROX(a, b) VERIFY(!test_isApprox(a, b))
|
||||
#define VERIFY_IS_MUCH_SMALLER_THAN(a, b) VERIFY(test_isMuchSmallerThan(a, b))
|
||||
|
||||
@@ -261,6 +261,22 @@ template<typename Scalar> void packetmath()
|
||||
VERIFY(isApproxAbs(data2[j], data1[i+j*PacketSize], refvalue) && "ptranspose");
|
||||
}
|
||||
}
|
||||
|
||||
if (internal::packet_traits<Scalar>::HasBlend) {
|
||||
Packet thenPacket = internal::pload<Packet>(data1);
|
||||
Packet elsePacket = internal::pload<Packet>(data2);
|
||||
EIGEN_ALIGN_DEFAULT internal::Selector<PacketSize> selector;
|
||||
for (int i = 0; i < PacketSize; ++i) {
|
||||
selector.select[i] = i;
|
||||
}
|
||||
|
||||
Packet blend = internal::pblend(selector, thenPacket, elsePacket);
|
||||
EIGEN_ALIGN_DEFAULT Scalar result[size];
|
||||
internal::pstore(result, blend);
|
||||
for (int i = 0; i < PacketSize; ++i) {
|
||||
VERIFY(isApproxAbs(result[i], (selector.select[i] ? data1[i] : data2[i]), refvalue));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template<typename Scalar> void packetmath_real()
|
||||
|
||||
@@ -39,15 +39,16 @@ void test_product_large()
|
||||
// check the functions to setup blocking sizes compile and do not segfault
|
||||
// FIXME check they do what they are supposed to do !!
|
||||
std::ptrdiff_t l1 = internal::random<int>(10000,20000);
|
||||
std::ptrdiff_t l2 = internal::random<int>(1000000,2000000);
|
||||
setCpuCacheSizes(l1,l2);
|
||||
std::ptrdiff_t l2 = internal::random<int>(100000,200000);
|
||||
std::ptrdiff_t l3 = internal::random<int>(1000000,2000000);
|
||||
setCpuCacheSizes(l1,l2,l3);
|
||||
VERIFY(l1==l1CacheSize());
|
||||
VERIFY(l2==l2CacheSize());
|
||||
std::ptrdiff_t k1 = internal::random<int>(10,100)*16;
|
||||
std::ptrdiff_t m1 = internal::random<int>(10,100)*16;
|
||||
std::ptrdiff_t n1 = internal::random<int>(10,100)*16;
|
||||
// only makes sure it compiles fine
|
||||
internal::computeProductBlockingSizes<float,float>(k1,m1,n1);
|
||||
internal::computeProductBlockingSizes<float,float>(k1,m1,n1,1);
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user