diff --git a/BUILD.bazel b/BUILD.bazel index ad396b04a70..3f38761d8d8 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -14,9 +14,6 @@ COMMON_COPTS = [ "-DHAVE_SHM_OPEN=1", "-DHAVE_SHM_UNLINK=1", "-D_FILE_OFFSET_BITS=64", - "-DHAVE_GCC_GET_CPUID", - "-DTH_BLAS_MKL", - "-DUSE_GCC_GET_CPUID", "-DTH_HAVE_THREAD", "-DUSE_FBGEMM", "-DUSE_DISTRIBUTED", @@ -369,8 +366,6 @@ cc_library( ) ATEN_COPTS = COMMON_COPTS + [ - "-DUSE_AVX", - "-DUSE_AVX2", "-DCAFFE2_BUILD_MAIN_LIBS", "-DHAVE_AVX_CPU_DEFINITION", "-DHAVE_AVX2_CPU_DEFINITION", @@ -1543,9 +1538,6 @@ cu_library( ) PERF_COPTS = [ - "-DHAVE_GCC_GET_CPUID", - "-DUSE_AVX", - "-DUSE_AVX2", "-DTH_HAVE_THREAD", "-DHAVE_AVX_CPU_DEFINITION", "-DHAVE_AVX2_CPU_DEFINITION", diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake index d8f2567d2c0..a16c0bfe2d3 100644 --- a/cmake/Dependencies.cmake +++ b/cmake/Dependencies.cmake @@ -824,8 +824,6 @@ if(USE_FBGEMM) endif() if(USE_FBGEMM) - set(CAFFE2_THIRD_PARTY_ROOT "${PROJECT_SOURCE_DIR}/third_party") - include_directories(SYSTEM "${CAFFE2_THIRD_PARTY_ROOT}") caffe2_update_option(USE_FBGEMM ON) else() caffe2_update_option(USE_FBGEMM OFF) @@ -1694,56 +1692,6 @@ if(NOT INTERN_BUILD_MOBILE) add_compile_options(-mcpu=cortex-a9) endif() - CHECK_INCLUDE_FILE(cpuid.h HAVE_CPUID_H) - # Check for a cpuid intrinsic - if(HAVE_CPUID_H) - CHECK_C_SOURCE_COMPILES("#include - int main() - { - unsigned int eax, ebx, ecx, edx; - return __get_cpuid(0, &eax, &ebx, &ecx, &edx); - }" HAVE_GCC_GET_CPUID) - endif() - if(HAVE_GCC_GET_CPUID) - add_compile_options(-DHAVE_GCC_GET_CPUID) - endif() - - CHECK_C_SOURCE_COMPILES("#include - static inline void cpuid(uint32_t *eax, uint32_t *ebx, - uint32_t *ecx, uint32_t *edx) - { - uint32_t a = *eax, b, c = *ecx, d; - asm volatile ( \"cpuid\" : \"+a\"(a), \"=b\"(b), \"+c\"(c), \"=d\"(d) ); - *eax = a; *ebx = b; *ecx = c; *edx = d; - } - int main() { - uint32_t a,b,c,d; - cpuid(&a, &b, &c, &d); - return 0; - }" NO_GCC_EBX_FPIC_BUG) - - if(NOT NO_GCC_EBX_FPIC_BUG) - add_compile_options(-DUSE_GCC_GET_CPUID) - endif() - - find_package(VSX) # checks VSX - find_package(ZVECTOR) # checks ZVECTOR - # checks AVX and AVX2. Already called once in MiscCheck.cmake. Called again here for clarity -- - # cached results will be used so no extra overhead. - find_package(AVX) - - # we don't set -mavx and -mavx2 flags globally, but only for specific files - # however, we want to enable the AVX codepaths, so we still need to - # add USE_AVX and USE_AVX2 macro defines - if(C_AVX_FOUND) - message(STATUS "AVX compiler support found") - add_compile_options(-DUSE_AVX) - endif() - if(C_AVX2_FOUND) - message(STATUS "AVX2 compiler support found") - add_compile_options(-DUSE_AVX2) - endif() - if(WIN32 AND NOT CYGWIN) set(BLAS_INSTALL_LIBRARIES "OFF" CACHE BOOL "Copy the required BLAS DLLs into the TH install dirs") diff --git a/third_party/mkl-dnn.BUILD b/third_party/mkl-dnn.BUILD index 74d83d430d1..5a4dd25ff6c 100644 --- a/third_party/mkl-dnn.BUILD +++ b/third_party/mkl-dnn.BUILD @@ -55,8 +55,6 @@ cc_library( "third_party/oneDNN/include/oneapi/dnnl/dnnl_version.h", ], copts = [ - "-DUSE_AVX", - "-DUSE_AVX2", "-DDNNL_DLL", "-DDNNL_DLL_EXPORTS", "-DDNNL_ENABLE_CONCURRENT_EXEC", diff --git a/third_party/sleef.BUILD b/third_party/sleef.BUILD index 837522c374d..f197a593b28 100644 --- a/third_party/sleef.BUILD +++ b/third_party/sleef.BUILD @@ -15,9 +15,6 @@ SLEEF_COPTS = [ "-fno-math-errno", "-fno-trapping-math", "-DCAFFE2_USE_GLOO", - "-DHAVE_GCC_GET_CPUID", - "-DUSE_AVX", - "-DUSE_AVX2", "-std=gnu99", ]