Registered Member
|
Hi,
I am trying to enable ARM NEON vectorization support for development on an Android phone using the Android NDK and the current Eigen trunk (or 3.0-beta2). It seems to me that ARM NEON support is still quite rough around the edges, i.e. not really functional yet. After enabling vectorization support by adding -mfpu=neon -mfloat-abi=softfp to the compiler options, I immediately ran into several compiler errors. Some of them I was able to fix by patching my compiler while others required modifications to the Eigen source code. Out of the box, compiling a translation unit of my program using the Android toolchain gave me errors related to casting a 'float*' to a 'float32_t*'. I figured that these errors are due to the issue discussed here: viewtopic.php?f=74&t=91183 so I applied the described patch to the toolchain and rebuilt it. As a consequence, these errors were gone but others remained, as listed here:
In order to remove these errors, I made the following changes to the code: > diff Complex.h Complex.h.FIX
> diff PacketMath.h PacketMath.h.FIX
I am not sure how well the ARM NEON related code has been put under scrutiny, but the several typos in variable name declarations should be easily caught in some unit tests. And while I also was able to remove all template-related syntax errors, I am not 100% certain that my changes are semantically correct, i.e. I did not attempt to understand the internals of the code but merely followed the template logic. Can one of the maintainers please have a look at the original code vs. my suggested patch and comment? The remaining problem is that my program (which uses Eigen for matrix addition, multiplication, inversion and SVD) now compiles without problems using vectorization support, but I only get bogus results. A non-vectorized build executes correctly. What are the best ways to find out where exactly the problems occur w.r.t. ARM NEON code? Are there any helper macros or functions for debugging this? Thanks for any help! Cheers, Michael |
Registered Member
|
Can you please run the test suite on NEON, http://eigen.tuxfamily.org/index.php?title=Tests you may have to do cmake -DEIGEN_TEST_NEON if it's not enabled by default. Please report any failure on bugzilla. It used to be working, perhaps there have been regression as it's not tested as often as x86 is.
Indeed, this pload<> wants the packet type here, so your patch is needed. Please file a bug, attach your patch (please generate with diff -u or hg diff) and send mail to Konstantinos (find his address in Core/arch/NEON/PacketMath.h) We must fix this.
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered Member
|
This is not going to be that trivial, as the only NEON device I have access to is an Android phone, for which I can only generate native shared libraries through the Google-supplied NDK build system, which are then linked to an executable to be run under the Dalvik virtual machine. No idea if I can somehow use cmake to build or run the tests or even how to easily remap stdout/stderr. Will still give it a try either this or next week.
Ok, will do asap. This stuff really needs to be fixed. Cheers, Michael |
Registered Member
|
As a quick update, I haven't run the test suite yet (not completely sure how, plus lack of time).
That said, Konstantinos's fix following my bug report (http://eigen.tuxfamily.org/bz/show_bug.cgi?id=129) removed my issues in enabling ARM NEON vectorization support in my program. Everything compiles and works for me now. Cheers, Michael |
Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft