This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Eigen 3.2.3 ARM NEON __pld not declared

Tags: None
(comma "," separated)
Eisi
Registered Member
Posts
1
Karma
0
Hi erveryone,

when i try to compile my code using an ARM-cross-compiler i get some error messages:

/home/User/projects/Eigen_323/Eigen/src/Core/arch/NEON/PacketMath.h: In function 'void Eigen::internal::prefetch(const Scalar*) [with Scalar = float]':
/home/User/projects/Eigen_323/Eigen/src/Core/arch/NEON/PacketMath.h:221:84: error: '__pld' was not declared in this scope
template<> EIGEN_STRONG_INLINE void prefetch<float>(const float* addr) { __pld(addr); }

/home/User/projects/Eigen_323/Eigen/src/Core/arch/NEON/PacketMath.h: In function 'void Eigen::internal::prefetch(const Scalar*) [with Scalar = int]':
/home/User/projects/Eigen_323/Eigen/src/Core/arch/NEON/PacketMath.h:222:84: error: '__pld' was not declared in this scope
template<> EIGEN_STRONG_INLINE void prefetch<int>(const int* addr) { __pld(addr); }

/home/User/projects/Eigen_323/Eigen/src/Core/arch/NEON/Complex.h: In function 'void Eigen::internal::prefetch(const Scalar*) [with Scalar = std::complex<float>]':
/home/User/projects/Eigen_323/Eigen/src/Core/arch/NEON/Complex.h:113:125: error: '__pld' was not declared in this scope
template<> EIGEN_STRONG_INLINE void prefetch<std::complex<float> >(const std::complex<float> * addr) { __pld((float *)addr); }


Does anybody know a solution for that?

--EDIT--
I just noticed, that it's working with Version 3.2.2.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
Could you test this patch, thank you:

Code: Select all
diff --git a/Eigen/src/Core/arch/NEON/Complex.h b/Eigen/src/Core/arch/NEON/Complex.h
--- a/Eigen/src/Core/arch/NEON/Complex.h
+++ b/Eigen/src/Core/arch/NEON/Complex.h
@@ -105,17 +105,17 @@ template<> EIGEN_STRONG_INLINE Packet2cf
 template<> EIGEN_STRONG_INLINE Packet2cf pload<Packet2cf>(const std::complex<float>* from) { EIGEN_DEBUG_ALIGNED_LOAD return Packet2cf(pload<Packet4f>((const float*)from)); }
 template<> EIGEN_STRONG_INLINE Packet2cf ploadu<Packet2cf>(const std::complex<float>* from) { EIGEN_DEBUG_UNALIGNED_LOAD return Packet2cf(ploadu<Packet4f>((const float*)from)); }
 
 template<> EIGEN_STRONG_INLINE Packet2cf ploaddup<Packet2cf>(const std::complex<float>* from) { return pset1<Packet2cf>(*from); }
 
 template<> EIGEN_STRONG_INLINE void pstore <std::complex<float> >(std::complex<float> *   to, const Packet2cf& from) { EIGEN_DEBUG_ALIGNED_STORE pstore((float*)to, from.v); }
 template<> EIGEN_STRONG_INLINE void pstoreu<std::complex<float> >(std::complex<float> *   to, const Packet2cf& from) { EIGEN_DEBUG_UNALIGNED_STORE pstoreu((float*)to, from.v); }
 
-template<> EIGEN_STRONG_INLINE void prefetch<std::complex<float> >(const std::complex<float> *   addr) { __pld((float *)addr); }
+template<> EIGEN_STRONG_INLINE void prefetch<std::complex<float> >(const std::complex<float> *   addr) { EIGEN_ARM_PREFETCH((float *)addr); }
 
 template<> EIGEN_STRONG_INLINE std::complex<float>  pfirst<Packet2cf>(const Packet2cf& a)
 {
   std::complex<float> EIGEN_ALIGN16 x[2];
   vst1q_f32((float *)x, a.v);
   return x[0];
 }
 
diff --git a/Eigen/src/Core/arch/NEON/PacketMath.h b/Eigen/src/Core/arch/NEON/PacketMath.h
--- a/Eigen/src/Core/arch/NEON/PacketMath.h
+++ b/Eigen/src/Core/arch/NEON/PacketMath.h
@@ -213,18 +213,18 @@ template<> EIGEN_STRONG_INLINE Packet4i
 }
 
 template<> EIGEN_STRONG_INLINE void pstore<float>(float*   to, const Packet4f& from) { EIGEN_DEBUG_ALIGNED_STORE vst1q_f32(to, from); }
 template<> EIGEN_STRONG_INLINE void pstore<int>(int*       to, const Packet4i& from) { EIGEN_DEBUG_ALIGNED_STORE vst1q_s32(to, from); }
 
 template<> EIGEN_STRONG_INLINE void pstoreu<float>(float*  to, const Packet4f& from) { EIGEN_DEBUG_UNALIGNED_STORE vst1q_f32(to, from); }
 template<> EIGEN_STRONG_INLINE void pstoreu<int>(int*      to, const Packet4i& from) { EIGEN_DEBUG_UNALIGNED_STORE vst1q_s32(to, from); }
 
-template<> EIGEN_STRONG_INLINE void prefetch<float>(const float* addr) { __pld(addr); }
-template<> EIGEN_STRONG_INLINE void prefetch<int>(const int*     addr) { __pld(addr); }
+template<> EIGEN_STRONG_INLINE void prefetch<float>(const float* addr) { EIGEN_ARM_PREFETCH(addr); }
+template<> EIGEN_STRONG_INLINE void prefetch<int>(const int*     addr) { EIGEN_ARM_PREFETCH(addr); }
 
 // FIXME only store the 2 first elements ?
 template<> EIGEN_STRONG_INLINE float  pfirst<Packet4f>(const Packet4f& a) { float EIGEN_ALIGN16 x[4]; vst1q_f32(x, a); return x[0]; }
 template<> EIGEN_STRONG_INLINE int    pfirst<Packet4i>(const Packet4i& a) { int   EIGEN_ALIGN16 x[4]; vst1q_s32(x, a); return x[0]; }
 
 template<> EIGEN_STRONG_INLINE Packet4f preverse(const Packet4f& a) {
   float32x2_t a_lo, a_hi;
   Packet4f a_r64;
Ayberk ??zg??r
Registered Member
Posts
1
Karma
0
The patch seems to have fixed the errors for me. Thanks!
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
Patch applied:

https://bitbucket.org/eigen/eigen/commits/3e99bd6c81d0/
Branch: 3.2
Date: 2015-01-13 08:25:24+00:00
Summary: Fix NEON compilation: use EIGEN_ARM_PREFETCH instead of __pld


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]