mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Fix/relax CMake linter rules (#35574)
Summary: Ignore mixed upper-case/lower-case style for now Fix space between function and its arguments violation Pull Request resolved: https://github.com/pytorch/pytorch/pull/35574 Test Plan: CI Differential Revision: D20712969 Pulled By: malfet fbshipit-source-id: 0012d430aed916b4518599a0b535e82d15721f78
This commit is contained in:
committed by
Facebook GitHub Bot
parent
96eec95ece
commit
b9adbb5002
@ -2,14 +2,14 @@ file(GLOB Detectron_CPU_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/*.cc)
|
||||
file(GLOB Detectron_GPU_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/*.cu)
|
||||
file(GLOB_RECURSE Detectron_HIP_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/*.hip)
|
||||
|
||||
if (BUILD_CAFFE2_OPS)
|
||||
if (USE_OPENMP AND OPENMP_FOUND)
|
||||
if(BUILD_CAFFE2_OPS)
|
||||
if(USE_OPENMP AND OPENMP_FOUND)
|
||||
Set(OpenMP_link ${OpenMP_CXX_LIBRARIES})
|
||||
endif()
|
||||
|
||||
# Note(ilijar): Since Detectron ops currently have no
|
||||
# CPU implementation, we only build GPU ops for now.
|
||||
if (USE_CUDA)
|
||||
if(USE_CUDA)
|
||||
CUDA_ADD_LIBRARY(
|
||||
caffe2_detectron_ops_gpu SHARED
|
||||
${Detectron_CPU_SRCS}
|
||||
@ -17,7 +17,7 @@ if (BUILD_CAFFE2_OPS)
|
||||
|
||||
target_link_libraries(caffe2_detectron_ops_gpu torch ${OpenMP_link})
|
||||
install(TARGETS caffe2_detectron_ops_gpu DESTINATION lib)
|
||||
if (MSVC)
|
||||
if(MSVC)
|
||||
install(FILES $<TARGET_PDB_FILE:caffe2_detectron_ops_gpu> DESTINATION lib OPTIONAL)
|
||||
endif()
|
||||
elseif(USE_ROCM)
|
||||
@ -34,7 +34,7 @@ if (BUILD_CAFFE2_OPS)
|
||||
add_library(caffe2_detectron_ops SHARED ${Detectron_CPU_SRCS})
|
||||
target_link_libraries(caffe2_detectron_ops torch ${OpenMP_link})
|
||||
install(TARGETS caffe2_detectron_ops DESTINATION lib)
|
||||
if (MSVC)
|
||||
if(MSVC)
|
||||
install(FILES $<TARGET_PDB_FILE:caffe2_detectron_ops> DESTINATION lib OPTIONAL)
|
||||
endif()
|
||||
endif()
|
||||
|
@ -1,4 +1,4 @@
|
||||
if (NOT CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO)
|
||||
if(NOT CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO)
|
||||
# If we are building the standalone module, we set the proper cmake variables.
|
||||
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
|
||||
find_package(Caffe2 REQUIRED)
|
||||
@ -6,14 +6,14 @@ if (NOT CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO)
|
||||
option(BUILD_SHARED_LIBS "Build shared libs." ON)
|
||||
endif()
|
||||
|
||||
if (BUILD_TEST)
|
||||
if(BUILD_TEST)
|
||||
add_library(
|
||||
caffe2_module_test_dynamic
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/module_test_dynamic.cc)
|
||||
|
||||
target_link_libraries(caffe2_module_test_dynamic torch_library)
|
||||
install(TARGETS caffe2_module_test_dynamic DESTINATION lib)
|
||||
if (MSVC AND BUILD_SHARED_LIBS)
|
||||
if(MSVC AND BUILD_SHARED_LIBS)
|
||||
install(FILES $<TARGET_PDB_FILE:caffe2_module_test_dynamic> DESTINATION lib OPTIONAL)
|
||||
endif()
|
||||
endif()
|
||||
|
@ -1,5 +1,5 @@
|
||||
if (CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO)
|
||||
if (NOT USE_OBSERVERS)
|
||||
if(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO)
|
||||
if(NOT USE_OBSERVERS)
|
||||
return()
|
||||
endif()
|
||||
else()
|
||||
@ -19,11 +19,11 @@ target_include_directories(caffe2_observers PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/.
|
||||
target_compile_options(caffe2_observers PRIVATE "-DCAFFE2_BUILD_OBSERVER_LIB")
|
||||
install(TARGETS caffe2_observers DESTINATION lib)
|
||||
caffe2_interface_library(caffe2_observers caffe2_observers_library)
|
||||
if (MSVC AND BUILD_SHARED_LIBS)
|
||||
if(MSVC AND BUILD_SHARED_LIBS)
|
||||
install(FILES $<TARGET_PDB_FILE:caffe2_observers> DESTINATION lib OPTIONAL)
|
||||
endif()
|
||||
|
||||
if (CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO)
|
||||
if(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO)
|
||||
set(Caffe2_MODULES ${Caffe2_MODULES} caffe2_observers_library PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
|
@ -19,8 +19,8 @@
|
||||
# (2) When we are not building with the main repo, we will need to do the usual
|
||||
# cmake setup: version checks, project options, find dependent packages,
|
||||
# etc.
|
||||
if (CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO)
|
||||
if (NOT USE_ROCKSDB)
|
||||
if(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO)
|
||||
if(NOT USE_ROCKSDB)
|
||||
return()
|
||||
endif()
|
||||
else()
|
||||
@ -69,6 +69,6 @@ install(TARGETS caffe2_rocksdb DESTINATION lib)
|
||||
# them.
|
||||
# Note(jiayq): this also depends on a separate cmake move to reorg test builds
|
||||
# and binary builds after modules. When it is done, this note should be removed.
|
||||
if (CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO)
|
||||
if(CAFFE2_CMAKE_BUILDING_WITH_MAIN_REPO)
|
||||
set(Caffe2_MODULES ${Caffe2_MODULES} caffe2_rocksdb PARENT_SCOPE)
|
||||
endif()
|
||||
|
Reference in New Issue
Block a user