Android convert/compile C++ as Neon -


i writing simple android program using c++ of jni , opencv. input image stored mat. instead of using opencv's normalize function, wish write own normalize function in c++. know, there support neon. however, looking @ helloneon sample in ndk folder, realised code written in neon instrinsics.

question: there way directly compile c++ code neon code? i.e. wish avoid writing function in neon intrinsics.

thank you.

largely depends on compiler. both gcc , clang support "automatic vectorizing" in recent versions, quality of generated code variable - depending on actual source code. always, compiler firstly responsible generating correct code, secondly generate fast/efficient code. if in doubt, go "safe" option.

it should, however, work use -mfpu=neon -ftree-vectorize.

i expect need "massage" code make vectorize well, - @ least that's experience on x86, compiler attempt build sse instructions when vectorizing. succeeds in simple cases, falls "regular code" when code more complex. later compilers work better older versions, rule.

if need vectorizing results, end needing use neon intrinsics.


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -