When building on 32bit linux ("i386" architecture) on a 64 bit machine, cmake will report CMAKE_SYSTEM_PROCESSOR as x86_64 - which is not intended. This currently causes NNPACK to detect x86-64 target when the psimd would be correct - the result is a mix of x86_64 and x86 object files and unhappy linkers.
This patch checks the pre-defined architecture macros for x86_32 and sets the backend to psimd if x86_32 is detected.
Compared to the ill-fated #161 it should leave x32 alone.
When building on 32bit linux ("i386" architecture) on a 64 bit machine, cmake will report CMAKE_SYSTEM_PROCESSOR as x86_64 - which is not intended. This currently causes NNPACK to detect x86-64 target when the psimd would be correct - the result is a mix of x86_64 and x86 object files and unhappy linkers. This patch checks the pre-defined architecture macros for x86_32 and sets the backend to psimd if x86_32 is detected. Compared to the ill-fated #161 it should leave x32 alone.