Commit 261f7db5 authored by Ilija Radosavovic's avatar Ilija Radosavovic Committed by Facebook Github Bot

Update CUDA presence checks for new style Caffe2 targets

Reviewed By: rbgirshick

Differential Revision: D7774100

fbshipit-source-id: e11d30fd817c8553ac6f2de16924eea3f78c8814
parent e5bb3a8f
......@@ -38,7 +38,7 @@ target_link_libraries(caffe2_detectron_custom_ops caffe2_library)
install(TARGETS caffe2_detectron_custom_ops DESTINATION lib)
# Install custom GPU ops lib, if gpu is present.
if (${HAVE_CUDA})
if (${CAFFE2_FOUND_CUDA})
# Additional -I prefix is required for CMake versions before commit (< 3.7):
# https://github.com/Kitware/CMake/commit/7ded655f7ba82ea72a82d0555449f2df5ef38594
list(APPEND CUDA_INCLUDE_DIRS -I${CAFFE2_INCLUDE_DIRS})
......
......@@ -11,8 +11,8 @@ function (detectron_print_config_summary)
message(STATUS " CXX flags : ${CMAKE_CXX_FLAGS}")
message(STATUS " Caffe2 version : ${CAFFE2_VERSION}")
message(STATUS " Caffe2 include path : ${CAFFE2_INCLUDE_DIRS}")
message(STATUS " Have CUDA : ${HAVE_CUDA}")
if (${HAVE_CUDA})
message(STATUS " Caffe2 found CUDA : ${CAFFE2_FOUND_CUDA}")
if (${CAFFE2_FOUND_CUDA})
message(STATUS " CUDA version : ${CUDA_VERSION}")
message(STATUS " CuDNN version : ${CUDNN_VERSION}")
endif()
......
# Adapted from https://github.com/caffe2/caffe2/blob/master/cmake/Summary.cmake
# Prints configuration summary.
function (detectron_print_config_summary)
message(STATUS "Summary:")
message(STATUS " CMake version : ${CMAKE_VERSION}")
message(STATUS " CMake command : ${CMAKE_COMMAND}")
message(STATUS " System name : ${CMAKE_SYSTEM_NAME}")
message(STATUS " C++ compiler : ${CMAKE_CXX_COMPILER}")
message(STATUS " C++ compiler version : ${CMAKE_CXX_COMPILER_VERSION}")
message(STATUS " CXX flags : ${CMAKE_CXX_FLAGS}")
message(STATUS " Caffe2 version : ${CAFFE2_VERSION}")
message(STATUS " Caffe2 include path : ${CAFFE2_INCLUDE_DIRS}")
message(STATUS " Have CUDA : ${HAVE_CUDA}")
if (${HAVE_CUDA})
message(STATUS " CUDA version : ${CUDA_VERSION}")
message(STATUS " CuDNN version : ${CUDNN_VERSION}")
endif()
endfunction()
......@@ -15,7 +15,7 @@ include(cmake/legacy/Utils.cmake)
include(cmake/legacy/Dependencies.cmake)
# Print configuration summary.
include(cmake/Summary.cmake)
include(cmake/legacy/Summary.cmake)
detectron_print_config_summary()
# Collect custom ops sources.
......@@ -34,7 +34,7 @@ target_link_libraries(caffe2_detectron_custom_ops caffe2)
install(TARGETS caffe2_detectron_custom_ops DESTINATION lib)
# Install custom GPU ops lib.
if (HAVE_CUDA)
if (${HAVE_CUDA})
# Additional -I prefix is required for CMake versions before commit (< 3.7):
# https://github.com/Kitware/CMake/commit/7ded655f7ba82ea72a82d0555449f2df5ef38594
list(APPEND CUDA_INCLUDE_DIRS -I${CAFFE2_INCLUDE_DIRS})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment