summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorParichay Kapoor <pk.kapoor@samsung.com>2020-09-15 17:43:17 +0900
committerParichay Kapoor <pk.kapoor@samsung.com>2020-09-15 17:43:17 +0900
commit695eb327736d79b43555f5661afeaa97576612e7 (patch)
treec157b48c2b634a58ff3a4cfc1805c6e4f1154cd2
parentd5d9a8fae9dd0bdde3f4856da8bd6d470feb84fc (diff)
downloadpytorch-695eb327736d79b43555f5661afeaa97576612e7.tar.gz
pytorch-695eb327736d79b43555f5661afeaa97576612e7.tar.bz2
pytorch-695eb327736d79b43555f5661afeaa97576612e7.zip
[caffe2] Solving bug with disabling all nnpackssandbox/kparichay/v1.6.0-rc1_protobuf_1.12.3
Instead of checking just USE_XNNPACK, check for all NNPACKS Change-Id: Idc566383322b0cad201e7d0e4c32b4da0c91c1ea Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
-rw-r--r--caffe2/CMakeLists.txt9
-rw-r--r--caffe2/utils/CMakeLists.txt2
2 files changed, 8 insertions, 3 deletions
diff --git a/caffe2/CMakeLists.txt b/caffe2/CMakeLists.txt
index fa685376f7..8920f7ff8e 100644
--- a/caffe2/CMakeLists.txt
+++ b/caffe2/CMakeLists.txt
@@ -87,8 +87,13 @@ endif()
# Note: the folders that are being commented out have not been properly
# addressed yet.
+set(DISABLE_NNPACK_AND_FAMILY OFF)
+if(NOT (USE_NNPACK OR USE_QNNPACK OR USE_PYTORCH_QNNPACK OR USE_XNNPACK))
+ set(DISABLE_NNPACK_AND_FAMILY ON)
+endif()
+
# For pthreadpool_new_if_impl. TODO: Remove when threadpools are unitied.
-if(NOT MSVC AND USE_XNNPACK)
+if(NOT MSVC AND NOT DISABLE_NNPACK_AND_FAMILY)
if(NOT TARGET fxdiv)
set(FXDIV_BUILD_TESTS OFF CACHE BOOL "")
set(FXDIV_BUILD_BENCHMARKS OFF CACHE BOOL "")
@@ -659,7 +664,7 @@ elseif(USE_CUDA)
endif()
-if(NOT MSVC AND USE_XNNPACK)
+if(NOT MSVC AND NOT DISABLE_NNPACK_AND_FAMILY)
TARGET_LINK_LIBRARIES(torch_cpu PRIVATE fxdiv)
endif()
diff --git a/caffe2/utils/CMakeLists.txt b/caffe2/utils/CMakeLists.txt
index 2925f4145b..a59250638a 100644
--- a/caffe2/utils/CMakeLists.txt
+++ b/caffe2/utils/CMakeLists.txt
@@ -36,7 +36,7 @@ list(APPEND Caffe2_CPU_SRCS
# ---[ threadpool/pthreadpool* is a local modification of the NNPACK
# pthreadpool with a very similar interface. Neither NNPACK, nor this
# thread pool supports Windows.
-if(NOT MSVC AND USE_XNNPACK)
+if(NOT MSVC AND NOT DISABLE_NNPACK_AND_FAMILY)
add_definitions(-DUSE_INTERNAL_THREADPOOL_IMPL)
set(Caffe2_CPU_SRCS ${Caffe2_CPU_SRCS}
utils/threadpool/pthreadpool.cc