[eigen] Trouble using ARM NEON vector instructions on Android |
[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]
/* To compile, set $NDK (path to Android NDK root directory) and $EIGEN3_DIR, then: $NDK/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ --sysroot=$NDK/platforms/android-14/arch-arm -march=armv7-a -mfloat-abi=softfp -mfpu=neon -mthumb -O2 -I$EIGEN3_DIR -isystem $NDK/platforms/android-14/arch-arm/usr/include -isystem $NDK/sources/cxx-stl/gnu-libstdc++/4.6/include -isystem $NDK/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi-v7a/include -S add_4f32.cpp -o add_4f32.cpp.s */ #include <Eigen/Dense> Eigen::Vector4f add_vector(const Eigen::Vector4f& v, const Eigen::Vector4f& w) { EIGEN_ASM_COMMENT("begin vector"); Eigen::Vector4f u = v + w; EIGEN_ASM_COMMENT("end vector"); return u; } Eigen::internal::Packet4f add_packet(Eigen::internal::Packet4f v, Eigen::internal::Packet4f w) { EIGEN_ASM_COMMENT("begin packet"); Eigen::internal::Packet4f u = Eigen::internal::padd(v, w); EIGEN_ASM_COMMENT("end packet"); return u; } float32x4_t add_intrinsic(float32x4_t v, float32x4_t w) { EIGEN_ASM_COMMENT("begin intrinsic"); float32x4_t u = vaddq_f32(v, w); EIGEN_ASM_COMMENT("end intrinsic"); return u; }
Attachment:
add_4f32.cpp.s
Description: Binary data
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |