mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Fix MSVC complex sqrt and packetmath test.
MSVC incorrectly handles `inf` cases for `std::sqrt<std::complex<T>>`. Here we replace it with a custom version (currently used on GPU). Also fixed the `packetmath` test, which previously skipped several corner cases since `CHECK_CWISE1` only tests the first `PacketSize` elements.
This commit is contained in:
committed by
Rasmus Munk Larsen
parent
8d9cfba799
commit
f149e0ebc3
@@ -115,6 +115,17 @@ template<typename Scalar> bool areApprox(const Scalar* a, const Scalar* b, int s
|
||||
VERIFY(test::areApprox(ref, data2, PacketSize) && #POP); \
|
||||
}
|
||||
|
||||
// Checks component-wise for input of size N. All of data1, data2, and ref
|
||||
// should have size at least ceil(N/PacketSize)*PacketSize to avoid memory
|
||||
// access errors.
|
||||
#define CHECK_CWISE1_N(REFOP, POP, N) { \
|
||||
for (int i=0; i<N; ++i) \
|
||||
ref[i] = REFOP(data1[i]); \
|
||||
for (int j=0; j<N; j+=PacketSize) \
|
||||
internal::pstore(data2 + j, POP(internal::pload<Packet>(data1 + j))); \
|
||||
VERIFY(test::areApprox(ref, data2, N) && #POP); \
|
||||
}
|
||||
|
||||
template<bool Cond,typename Packet>
|
||||
struct packet_helper
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user