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

ARM NEON Complex-Float Bug

Tags: None
(comma "," separated)
User avatar
willo
Registered Member
Posts
14
Karma
0
OS

ARM NEON Complex-Float Bug

Thu May 05, 2011 9:22 pm
Eigen folks,

I believe I uncovered a bug with Eigen-3.0.0. When building for ARM NEON ( g++ flags of "-mfpu=neon -mfloat-abi=softfp" ) code that uses complex floats, I get the following error:

include/eigen3/Eigen/src/Core/Assign.h:413: error: 'AlignedOnScalar' is not a member of 'Eigen::internal::assign_impl<Derived1, Derived2, 3, 0>::run(Derived1&, const Derived2&) [with Derived1 = Eigen::Matrix<std::complex<float>, -0x00000000000000001, 1, 0, -0x00000000000000001, 1>, Derived2 = Eigen::Matrix<std::complex<float>, -0x00000000000000001, 1, 0, -0x00000000000000001, 1>]::PacketTraits'


Doing a bit of sleuthing, I think that include/eigen3/Eigen/src/Core/arch/NEON/Complex.h's packet_traits<std::complex<float> > needs 'AlignedOnScalar' defined. I defined this, set it as '1', and am able to get past this compiling error.

I would like to confirm this is indeed a bug, and that I applied the correct fix.

Here are my example code:

Code: Select all
#include <Eigen/Dense>
#include <iostream>

int main( int argc, char* argv[] )
{
  using namespace Eigen;
  using namespace std;

  VectorXcf v1 = VectorXcf::Random( 1024u );
  VectorXcf v2 = VectorXcf::Random( 1024u );

  for( size_t i = 0u; i != 100000u; ++i )
  {
    asm("#it begins here!");
    v1 += i*v2;
    asm("#it ends here!");
  }

  cout << v1.prod() << endl;

  return 0;
}


Here is the output of 'diff' on the modified include/eigen3/Eigen/src/Core/arch/NEON/Complex.h file:

--- eigen-3.0.0/Eigen/src/Core/arch/NEON/Complex.h.orig 2011-05-05 15:43:14.596208000 -0400
+++ eigen-3.0.0/Eigen/src/Core/arch/NEON/Complex.h 2011-05-05 15:44:07.127823000 -0400
@@ -43,6 +43,7 @@
typedef Packet2cf type;
enum {
Vectorizable = 1,
+ AlignedOnScalar = 1,
size = 2,

HasAdd = 1,
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: ARM NEON Complex-Float Bug

Fri May 06, 2011 7:00 am
this is the right fix. the pb is that's quite difficult for us to test ARM NEON on a regular basis. (fix committed)
User avatar
willo
Registered Member
Posts
14
Karma
0
OS

Re: ARM NEON Complex-Float Bug

Fri May 06, 2011 1:51 pm
Gaël,

Thanks for the quick reply.

I didn't intend this question to a criticism of your ARM NEON support. I'm very happy that porting my code from Intel to ARM has been relatively pain-less.

I do have a few more questions / bugs forthcoming. I'll post those as separate messages.

Do you, or any of the active Eigen developers have access to an ARM NEON device?
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: ARM NEON Complex-Float Bug

Fri May 06, 2011 7:05 pm
indeed, main developers do not have access to an ARM NEON device. I did some tests with emulators but that's very painful and limited to some very simple tests...
User avatar
willo
Registered Member
Posts
14
Karma
0
OS

Re: ARM NEON Complex-Float Bug

Fri May 06, 2011 8:16 pm
I'm sorry to hear about that. :-(

Would either of the following options be viable for testing & development:
  • physically having a ARM device?
  • having an account on a remotely managed ARM device?
If both, which is preferable?
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: ARM NEON Complex-Float Bug

Sat May 07, 2011 7:01 am
remote access would already be very great.
User avatar
willo
Registered Member
Posts
14
Karma
0
OS

Re: ARM NEON Complex-Float Bug

Thu May 12, 2011 7:12 pm
I'm unsure if I could get my employer to agree to give you direct access to my development board. :-(

Have you looked into any UNIX development clusters online? Doing a quick search, I found the GNU GCC Compiler-Farm:
http://gcc.gnu.org/wiki/CompileFarm
It is available to any GNU-like licensed software developers. Maybe this could be a way to get access to an ARM NEON, as well as other platform, machines?
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: ARM NEON Complex-Float Bug

Thu May 12, 2011 7:41 pm
thanks for the link, I'm applying right now


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], q.ignora, watchstar