rename BUILD_ATEN_MOBILE to INTERN_BUILD_MOBILE and make it private (#19942)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19942
ghimport-source-id: 6bacc8f5ad7911af8cf5fde9fcb604ade666b862

Reviewed By: dzhulgakov

Differential Revision: D15144325

Pulled By: ljk53

fbshipit-source-id: d63a70f007110d5d1055d6bec1ed09a1a6aafdae
This commit is contained in:
Jiakai Liu 2019-05-01 00:16:13 -07:00 committed by Facebook Github Bot
parent 5108e807e0
commit 8cd6d2f101
8 changed files with 15 additions and 15 deletions

View file

@ -63,7 +63,6 @@ endif()
include(CMakeDependentOption)
option(BUILD_TORCH "Build Torch" OFF)
option(ATEN_NO_TEST "Do not build ATen test binaries" OFF)
option(BUILD_ATEN_MOBILE "Build ATen for Android and iOS" OFF)
option(BUILD_ATEN_ONLY "Build only a subset focused on ATen only" OFF)
option(BUILD_BINARY "Build C++ binaries" OFF)
option(BUILD_DOCS "Build Caffe2 documentation" OFF)
@ -165,8 +164,10 @@ if (MSVC)
endforeach(flag_var)
endif(MSVC)
# Set INTERN_BUILD_MOBILE for all mobile builds. Components that are not
# applicable to mobile are disabled by this variable.
if (ANDROID OR IOS)
set(BUILD_ATEN_MOBILE ON)
set(INTERN_BUILD_MOBILE ON)
endif()
if (BUILD_ATEN_ONLY)

View file

@ -1,4 +1,4 @@
if (BUILD_ATEN_MOBILE)
if (INTERN_BUILD_MOBILE)
return()
endif()

View file

@ -4,7 +4,7 @@ include(../cmake/Codegen.cmake)
# ---[ Declare source file lists
# ---[ ATen build
if (NOT BUILD_ATEN_MOBILE)
if (NOT INTERN_BUILD_MOBILE)
set(__caffe2_CMAKE_POSITION_INDEPENDENT_CODE ${CMAKE_POSITION_INDEPENDENT_CODE})
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(AT_LINK_STYLE INTERFACE)
@ -405,7 +405,7 @@ if(USE_ROCM)
target_compile_options(caffe2_hip PRIVATE ${HIP_CXX_FLAGS})
target_link_libraries(caffe2_hip PUBLIC caffe2)
target_link_libraries(caffe2_hip PUBLIC c10_hip)
if(NOT BUILD_ATEN_MOBILE)
if(NOT INTERN_BUILD_MOBILE)
# TODO: Cut this over to ATEN_HIP_FILES_GEN_LIB. At the moment, we
# only generate CUDA files
# NB: This dependency must be PRIVATE, because we don't install

View file

@ -1,4 +1,4 @@
if(NOT BUILD_ATEN_MOBILE AND BUILD_CAFFE2_OPS)
if(NOT INTERN_BUILD_MOBILE AND BUILD_CAFFE2_OPS)
# Add source generated by Codegen.cmake and pass to parent
list(APPEND Caffe2_CPU_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/aten_op.cc)
list(APPEND Caffe2_GPU_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/aten_op_gpu.cc)

View file

@ -43,7 +43,7 @@ configure_file(
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/../caffe2
DESTINATION include
FILES_MATCHING PATTERN "*.h")
if (BUILD_ATEN_MOBILE)
if (INTERN_BUILD_MOBILE)
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/../aten/src/ATen/core
DESTINATION include/ATen
FILES_MATCHING PATTERN "*.h")
@ -52,7 +52,7 @@ install(FILES ${CMAKE_BINARY_DIR}/caffe2/core/macros.h
DESTINATION include/caffe2/core)
# ---[ ATen specific
if (NOT BUILD_ATEN_MOBILE)
if (NOT INTERN_BUILD_MOBILE)
SET(OPT_FLAG "-O3 ")
IF(MSVC)
SET(OPT_FLAG "/Ox /fp:strict ")

View file

@ -81,7 +81,7 @@ if(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO)
endif()
# ---[ BLAS
if(NOT BUILD_ATEN_MOBILE)
if(NOT INTERN_BUILD_MOBILE)
set(BLAS "MKL" CACHE STRING "Selected BLAS library")
else()
set(BLAS "Eigen" CACHE STRING "Selected BLAS library")
@ -131,7 +131,7 @@ else()
endif()
if (NOT BUILD_ATEN_MOBILE)
if (NOT INTERN_BUILD_MOBILE)
set(AT_MKL_ENABLED 0)
set(AT_MKL_MT 0)
set(USE_BLAS 1)
@ -988,7 +988,7 @@ if (USE_NNAPI AND NOT ANDROID)
caffe2_update_option(USE_NNAPI OFF)
endif()
if (NOT BUILD_ATEN_MOBILE AND BUILD_CAFFE2_OPS)
if (NOT INTERN_BUILD_MOBILE AND BUILD_CAFFE2_OPS)
if (CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO)
list(APPEND Caffe2_DEPENDENCY_LIBS aten_op_header_gen)
if (USE_CUDA)
@ -1065,7 +1065,7 @@ if (CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO)
endif()
# --[ ATen checks
if (NOT BUILD_ATEN_MOBILE)
if (NOT INTERN_BUILD_MOBILE)
set(TORCH_CUDA_ARCH_LIST $ENV{TORCH_CUDA_ARCH_LIST})
set(TORCH_NVCC_FLAGS $ENV{TORCH_NVCC_FLAGS})
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)

View file

@ -37,7 +37,7 @@ if(EXISTS "/etc/os-release")
endif()
endif()
if (NOT BUILD_ATEN_MOBILE)
if (NOT INTERN_BUILD_MOBILE)
# ---[ Check that our programs run. This is different from the native CMake
# compiler check, which just tests if the program compiles and links. This is
# important because with ASAN you might need to help the compiled library find
@ -59,7 +59,7 @@ if (NOT BUILD_ATEN_MOBILE)
cmake_pop_check_state()
endif()
if (NOT BUILD_ATEN_MOBILE)
if (NOT INTERN_BUILD_MOBILE)
# ---[ Check if certain std functions are supported. Sometimes
# _GLIBCXX_USE_C99 macro is not defined and some functions are missing.
cmake_push_check_state(RESET)

View file

@ -20,7 +20,6 @@ function (caffe2_print_configuration_summary)
message(STATUS " TORCH_VERSION : ${TORCH_VERSION}")
message(STATUS " CAFFE2_VERSION : ${CAFFE2_VERSION}")
message(STATUS " BUILD_ATEN_MOBILE : ${BUILD_ATEN_MOBILE}")
message(STATUS " BUILD_ATEN_ONLY : ${BUILD_ATEN_ONLY}")
message(STATUS " BUILD_BINARY : ${BUILD_BINARY}")
message(STATUS " BUILD_CUSTOM_PROTOBUF : ${BUILD_CUSTOM_PROTOBUF}")