mirror of
				https://github.com/pytorch/pytorch.git
				synced 2025-11-04 08:00:58 +08:00 
			
		
		
		
	Remove unused build system checks and definitions (#109711)
Remove some outdated checks. Pull Request resolved: https://github.com/pytorch/pytorch/pull/109711 Approved by: https://github.com/ezyang
This commit is contained in:
		@ -20,7 +20,6 @@ COMMON_COPTS = [
 | 
				
			|||||||
    "-DHAVE_SHM_OPEN=1",
 | 
					    "-DHAVE_SHM_OPEN=1",
 | 
				
			||||||
    "-DHAVE_SHM_UNLINK=1",
 | 
					    "-DHAVE_SHM_UNLINK=1",
 | 
				
			||||||
    "-D_FILE_OFFSET_BITS=64",
 | 
					    "-D_FILE_OFFSET_BITS=64",
 | 
				
			||||||
    "-DTH_HAVE_THREAD",
 | 
					 | 
				
			||||||
    "-DUSE_FBGEMM",
 | 
					    "-DUSE_FBGEMM",
 | 
				
			||||||
    "-DUSE_DISTRIBUTED",
 | 
					    "-DUSE_DISTRIBUTED",
 | 
				
			||||||
    "-DAT_PER_OPERATOR_HEADERS",
 | 
					    "-DAT_PER_OPERATOR_HEADERS",
 | 
				
			||||||
@ -268,7 +267,6 @@ header_template_rule(
 | 
				
			|||||||
        "@AT_MKLDNN_ACL_ENABLED@": "0",
 | 
					        "@AT_MKLDNN_ACL_ENABLED@": "0",
 | 
				
			||||||
        "@AT_MKL_ENABLED@": "1",
 | 
					        "@AT_MKL_ENABLED@": "1",
 | 
				
			||||||
        "@AT_MKL_SEQUENTIAL@": "0",
 | 
					        "@AT_MKL_SEQUENTIAL@": "0",
 | 
				
			||||||
        "@AT_FFTW_ENABLED@": "0",
 | 
					 | 
				
			||||||
        "@AT_POCKETFFT_ENABLED@": "0",
 | 
					        "@AT_POCKETFFT_ENABLED@": "0",
 | 
				
			||||||
        "@AT_NNPACK_ENABLED@": "0",
 | 
					        "@AT_NNPACK_ENABLED@": "0",
 | 
				
			||||||
        "@CAFFE2_STATIC_LINK_CUDA_INT@": "0",
 | 
					        "@CAFFE2_STATIC_LINK_CUDA_INT@": "0",
 | 
				
			||||||
@ -1471,7 +1469,6 @@ cu_library(
 | 
				
			|||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
PERF_COPTS = [
 | 
					PERF_COPTS = [
 | 
				
			||||||
    "-DTH_HAVE_THREAD",
 | 
					 | 
				
			||||||
    "-DHAVE_AVX_CPU_DEFINITION",
 | 
					    "-DHAVE_AVX_CPU_DEFINITION",
 | 
				
			||||||
    "-DHAVE_AVX2_CPU_DEFINITION",
 | 
					    "-DHAVE_AVX2_CPU_DEFINITION",
 | 
				
			||||||
    "-DENABLE_ALIAS=1",
 | 
					    "-DENABLE_ALIAS=1",
 | 
				
			||||||
 | 
				
			|||||||
@ -10,7 +10,6 @@
 | 
				
			|||||||
#define AT_MKLDNN_ACL_ENABLED() @AT_MKLDNN_ACL_ENABLED@
 | 
					#define AT_MKLDNN_ACL_ENABLED() @AT_MKLDNN_ACL_ENABLED@
 | 
				
			||||||
#define AT_MKL_ENABLED() @AT_MKL_ENABLED@
 | 
					#define AT_MKL_ENABLED() @AT_MKL_ENABLED@
 | 
				
			||||||
#define AT_MKL_SEQUENTIAL() @AT_MKL_SEQUENTIAL@
 | 
					#define AT_MKL_SEQUENTIAL() @AT_MKL_SEQUENTIAL@
 | 
				
			||||||
#define AT_FFTW_ENABLED() @AT_FFTW_ENABLED@
 | 
					 | 
				
			||||||
#define AT_POCKETFFT_ENABLED() @AT_POCKETFFT_ENABLED@
 | 
					#define AT_POCKETFFT_ENABLED() @AT_POCKETFFT_ENABLED@
 | 
				
			||||||
#define AT_NNPACK_ENABLED() @AT_NNPACK_ENABLED@
 | 
					#define AT_NNPACK_ENABLED() @AT_NNPACK_ENABLED@
 | 
				
			||||||
#define CAFFE2_STATIC_LINK_CUDA() @CAFFE2_STATIC_LINK_CUDA_INT@
 | 
					#define CAFFE2_STATIC_LINK_CUDA() @CAFFE2_STATIC_LINK_CUDA_INT@
 | 
				
			||||||
 | 
				
			|||||||
@ -1050,9 +1050,6 @@ def define_buck_targets(
 | 
				
			|||||||
            "@AT_MKL_SEQUENTIAL@",
 | 
					            "@AT_MKL_SEQUENTIAL@",
 | 
				
			||||||
            "ATEN_MKL_SEQUENTIAL_FBXPLAT",
 | 
					            "ATEN_MKL_SEQUENTIAL_FBXPLAT",
 | 
				
			||||||
            "--replace",
 | 
					            "--replace",
 | 
				
			||||||
            "@AT_FFTW_ENABLED@",
 | 
					 | 
				
			||||||
            "0",
 | 
					 | 
				
			||||||
            "--replace",
 | 
					 | 
				
			||||||
            "@AT_POCKETFFT_ENABLED@",
 | 
					            "@AT_POCKETFFT_ENABLED@",
 | 
				
			||||||
            "1",
 | 
					            "1",
 | 
				
			||||||
            "--replace",
 | 
					            "--replace",
 | 
				
			||||||
 | 
				
			|||||||
@ -281,21 +281,6 @@ elseif(INTERN_USE_EIGEN_BLAS)
 | 
				
			|||||||
  list(APPEND Caffe2_DEPENDENCY_LIBS eigen_blas)
 | 
					  list(APPEND Caffe2_DEPENDENCY_LIBS eigen_blas)
 | 
				
			||||||
endif()
 | 
					endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# ---[ FFTW
 | 
					 | 
				
			||||||
set(AT_FFTW_ENABLED 0)
 | 
					 | 
				
			||||||
set(USE_FFTW OFF)
 | 
					 | 
				
			||||||
if(USE_FFTW OR NOT MKL_FOUND)
 | 
					 | 
				
			||||||
  find_library(LIBFFTW3 fftw3)
 | 
					 | 
				
			||||||
  if(LIBFFTW3)
 | 
					 | 
				
			||||||
    find_path(FFTW3_INCLUDE_DIR NAMES fftw3.h ONLY_CMAKE_FIND_ROOT_PATH)
 | 
					 | 
				
			||||||
    if(FFTW3_INCLUDE_DIR)
 | 
					 | 
				
			||||||
      SET(AT_FFTW_ENABLED 1)
 | 
					 | 
				
			||||||
      SET(USE_FFTW ON)
 | 
					 | 
				
			||||||
      include_directories(${FFTW3_INCLUDE_DIR})
 | 
					 | 
				
			||||||
    endif()
 | 
					 | 
				
			||||||
  endif()
 | 
					 | 
				
			||||||
endif()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# --- [ PocketFFT
 | 
					# --- [ PocketFFT
 | 
				
			||||||
set(AT_POCKETFFT_ENABLED 0)
 | 
					set(AT_POCKETFFT_ENABLED 0)
 | 
				
			||||||
if(NOT AT_MKL_ENABLED)
 | 
					if(NOT AT_MKL_ENABLED)
 | 
				
			||||||
@ -1814,18 +1799,6 @@ if(NOT INTERN_BUILD_MOBILE)
 | 
				
			|||||||
  add_definitions(-DUSE_EXTERNAL_MZCRC)
 | 
					  add_definitions(-DUSE_EXTERNAL_MZCRC)
 | 
				
			||||||
  add_definitions(-DMINIZ_DISABLE_ZIP_READER_CRC32_CHECKS)
 | 
					  add_definitions(-DMINIZ_DISABLE_ZIP_READER_CRC32_CHECKS)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  # Is __thread supported?
 | 
					 | 
				
			||||||
  if(NOT MSVC)
 | 
					 | 
				
			||||||
    CHECK_C_SOURCE_COMPILES("static __thread int x = 1; int main() { return x; }" C_HAS_THREAD)
 | 
					 | 
				
			||||||
  else(NOT MSVC)
 | 
					 | 
				
			||||||
    CHECK_C_SOURCE_COMPILES("static __declspec( thread ) int x = 1; int main() { return x; }" C_HAS_THREAD)
 | 
					 | 
				
			||||||
  endif(NOT MSVC)
 | 
					 | 
				
			||||||
  if(NOT C_HAS_THREAD)
 | 
					 | 
				
			||||||
    message(STATUS "Warning: __thread is not supported, generating thread-unsafe code")
 | 
					 | 
				
			||||||
  else(NOT C_HAS_THREAD)
 | 
					 | 
				
			||||||
    add_compile_options(-DTH_HAVE_THREAD)
 | 
					 | 
				
			||||||
  endif(NOT C_HAS_THREAD)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  find_package(ZVECTOR) # s390x simd support
 | 
					  find_package(ZVECTOR) # s390x simd support
 | 
				
			||||||
endif()
 | 
					endif()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -141,7 +141,6 @@ function(caffe2_print_configuration_summary)
 | 
				
			|||||||
  message(STATUS "  USE_PYTORCH_METAL     : ${USE_PYTORCH_METAL}")
 | 
					  message(STATUS "  USE_PYTORCH_METAL     : ${USE_PYTORCH_METAL}")
 | 
				
			||||||
  message(STATUS "  USE_PYTORCH_METAL_EXPORT     : ${USE_PYTORCH_METAL_EXPORT}")
 | 
					  message(STATUS "  USE_PYTORCH_METAL_EXPORT     : ${USE_PYTORCH_METAL_EXPORT}")
 | 
				
			||||||
  message(STATUS "  USE_MPS               : ${USE_MPS}")
 | 
					  message(STATUS "  USE_MPS               : ${USE_MPS}")
 | 
				
			||||||
  message(STATUS "  USE_FFTW              : ${USE_FFTW}")
 | 
					 | 
				
			||||||
  message(STATUS "  USE_MKL               : ${CAFFE2_USE_MKL}")
 | 
					  message(STATUS "  USE_MKL               : ${CAFFE2_USE_MKL}")
 | 
				
			||||||
  message(STATUS "  USE_MKLDNN            : ${USE_MKLDNN}")
 | 
					  message(STATUS "  USE_MKLDNN            : ${USE_MKLDNN}")
 | 
				
			||||||
  if(${USE_MKLDNN})
 | 
					  if(${USE_MKLDNN})
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										1
									
								
								defs.bzl
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								defs.bzl
									
									
									
									
									
								
							@ -29,7 +29,6 @@ default_compiler_flags = [
 | 
				
			|||||||
    "-DHAVE_SHM_OPEN=1",
 | 
					    "-DHAVE_SHM_OPEN=1",
 | 
				
			||||||
    "-DHAVE_SHM_UNLINK=1",
 | 
					    "-DHAVE_SHM_UNLINK=1",
 | 
				
			||||||
    "-DHAVE_MALLOC_USABLE_SIZE=1",
 | 
					    "-DHAVE_MALLOC_USABLE_SIZE=1",
 | 
				
			||||||
    "-DTH_HAVE_THREAD",
 | 
					 | 
				
			||||||
    "-DCPU_CAPABILITY_DEFAULT",
 | 
					    "-DCPU_CAPABILITY_DEFAULT",
 | 
				
			||||||
    "-DTH_INDEX_BASE=0",
 | 
					    "-DTH_INDEX_BASE=0",
 | 
				
			||||||
    "-DMAGMA_V2",
 | 
					    "-DMAGMA_V2",
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user