Maratyszcza / NNPACK

Acceleration package for neural networks on multi-core CPUs
BSD 2-Clause "Simplified" License
1.68k stars 316 forks source link

Fix x86 32 bit detection #162

Closed t-vi closed 5 years ago

t-vi commented 5 years ago

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.

t-vi commented 5 years ago

Thank you for the feedback!