From: Thomas Viehmann Date: Wed, 13 Mar 2019 10:43:58 +0000 (-0700) Subject: Disable FBGEMM when building under x86 32bit (#17922) X-Git-Tag: accepted/tizen/6.5/unified/20211028.231830~834 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7e34bd230bbbb24d184ab2c725f711ea3a279713;p=platform%2Fupstream%2Fpytorch.git Disable FBGEMM when building under x86 32bit (#17922) Summary: FBGEMM doesn't work on x86 32bit and prior to this patch, it will generate x86_64 objects in a build that is supposed to be x86 32bit. FBGEMM actually relies on registers not available on x86_32, so we disable it. This takes of one element of #17901. There are more dependencies and a separate PR (#17915) regarding AVX detection for the code in the main repository. Pull Request resolved: https://github.com/pytorch/pytorch/pull/17922 Differential Revision: D14437340 Pulled By: soumith fbshipit-source-id: bd9fc98cf607d9b0bc28127fbbc8b04fa10eecbe --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 9ef8bc1..2f79094 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -221,6 +221,11 @@ include(cmake/MiscCheck.cmake) include(ExternalProject) # ---[ Dependencies +# ---[ FBGEMM doesn't work on x86 32bit and CMAKE_SYSTEM_PROCESSOR thinks its 64bit +if(USE_FBGEMM AND ((CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND CMAKE_SIZEOF_VOID_P EQUAL 4) OR CMAKE_SYSTEM_PROCESSOR STREQUAL "x86")) + set(USE_FBGEMM OFF) +endif() + include(cmake/Dependencies.cmake) if(USE_FBGEMM)