Skip to content

Commit 6211989

Browse files
Ailing Zhangfacebook-github-bot
Ailing Zhang
authored andcommitted
Move USE_NUMPY to more appropriate targets (pytorch#51143)
Summary: Pull Request resolved: pytorch#51143 Test Plan: CI Reviewed By: wconstab Differential Revision: D26084123 fbshipit-source-id: af4abe4ef87c1ebe5434938320526a925f5c34c8
1 parent 2de4ecd commit 6211989

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

caffe2/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1484,6 +1484,7 @@ if(BUILD_PYTHON)
14841484
# ---[ Python.
14851485
if(BUILD_CAFFE2)
14861486
add_library(caffe2_pybind11_state MODULE ${Caffe2_CPU_PYTHON_SRCS})
1487+
target_compile_options(caffe2_pybind11_state PRIVATE "-DUSE_NUMPY")
14871488
if(NOT MSVC)
14881489
set_target_properties(caffe2_pybind11_state PROPERTIES COMPILE_FLAGS "-fvisibility=hidden")
14891490
endif()
@@ -1514,6 +1515,7 @@ if(BUILD_PYTHON)
15141515

15151516
if(USE_CUDA)
15161517
add_library(caffe2_pybind11_state_gpu MODULE ${Caffe2_GPU_PYTHON_SRCS})
1518+
target_compile_options(caffe2_pybind11_state_gpu PRIVATE "-DUSE_NUMPY")
15171519
if(NOT MSVC)
15181520
set_target_properties(caffe2_pybind11_state_gpu PROPERTIES COMPILE_FLAGS "-fvisibility=hidden")
15191521
endif()
@@ -1542,6 +1544,7 @@ if(BUILD_PYTHON)
15421544

15431545
if(USE_ROCM)
15441546
add_library(caffe2_pybind11_state_hip MODULE ${Caffe2_HIP_PYTHON_SRCS})
1547+
target_compile_options(caffe2_pybind11_state_hip PRIVATE "-DUSE_NUMPY")
15451548
if(NOT MSVC)
15461549
target_compile_options(caffe2_pybind11_state_hip PRIVATE ${HIP_CXX_FLAGS} -fvisibility=hidden)
15471550
endif()

caffe2/core/macros.h.in

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@ static_assert(
4444
#cmakedefine CAFFE2_USE_NVTX
4545
#cmakedefine CAFFE2_USE_TRT
4646

47-
#ifndef USE_NUMPY
48-
#cmakedefine USE_NUMPY
49-
#endif
50-
5147
#ifndef EIGEN_MPL2_ONLY
5248
#cmakedefine EIGEN_MPL2_ONLY
5349
#endif

0 commit comments

Comments
 (0)