Skip to content

Commit 2ae710c

Browse files
jacobkahnvineelkpratap
authored and
vineelkpratap
committed
Don't require one autograd backend's deps if building the other
Summary: Stop requiring CUDA if building the CPU backend, and stop requiring MKL/MKL-DNN if building the CUDA backend. Stop throwing if MKL-DNN components are missing - rely on `find_package_handle_standard_args` Reviewed By: vineelpratap Differential Revision: D13545117 fbshipit-source-id: 58409c657b952eb7205ba0574b00b338a890ed92
1 parent a5e3629 commit 2ae710c

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

CMakeLists.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ else()
8181
endif()
8282

8383
# -------------------- Locate Backend-specific Dependencies --------------------
84-
find_package(CUDA 9.2) # CUDA 9.2 is required for >= ArrayFire 3.6.1
84+
find_package(CUDA 9.2 QUIET) # CUDA 9.2 is required for >= ArrayFire 3.6.1
8585
if (CUDA_FOUND)
8686
message(STATUS "CUDA found (library: ${CUDA_LIBRARIES} include: ${CUDA_INCLUDE_DIRS})")
8787
else()
@@ -101,7 +101,7 @@ else()
101101
endif ()
102102
endif()
103103

104-
find_package(MKL)
104+
find_package(MKL QUIET)
105105
if (MKL_FOUND)
106106
message(STATUS "MKL found")
107107
else()
@@ -111,7 +111,7 @@ else()
111111
endif()
112112
endif()
113113

114-
find_package(MKLDNN)
114+
find_package(MKLDNN QUIET)
115115
if (MKLDNN_FOUND)
116116
message(STATUS "MKLDNN found")
117117
else()

cmake/FindMKLDNN.cmake

+3-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ set(MKLDNN_INCLUDE_DIR)
1616
find_package(BLAS)
1717

1818
if (NOT MKL_FOUND)
19-
message(FATAL_ERROR "Cannot build MKLDNN without MKL in current configuration.")
19+
message(STATUS "Attempting to build MKLDNN without MKL in current configuration.")
2020
# TODO(@jacobkahn) support building MKLDNN with standalone Intel libmklml
2121
endif()
2222

@@ -35,8 +35,7 @@ find_path(
3535
if (MKLDNN_INCLUDE_DIR)
3636
message(STATUS "MKLDNN headers found in ${MKLDNN_INCLUDE_DIR}")
3737
else()
38-
message(FATAL_ERROR "MKLDNN headers not found; please set CMAKE_INCLUDE_PATH or
39-
MKLDNN_ROOT")
38+
message(STATUS "MKLDNN headers not found; please set CMAKE_INCLUDE_PATH or MKLDNN_ROOT")
4039
endif()
4140

4241
# Find library
@@ -54,8 +53,7 @@ find_library(
5453
if (MKLDNN_LIBRARY)
5554
message(STATUS "Using MKLDNN library found in ${MKLDNN_LIBRARY}")
5655
else()
57-
message(FATAL_ERROR "MKLDNN library not found; please set CMAKE_LIBRARY_PATH o
58-
r MKLDNN_LIBRARY")
56+
message(STATUS "MKLDNN library not found; please set CMAKE_LIBRARY_PATH or MKLDNN_LIBRARY")
5957
endif()
6058

6159
set(MKLDNN_LIBRARIES ${MKLDNN_LIBRARY})

0 commit comments

Comments
 (0)