cjolivier01 commented on a change in pull request #9672: CMake CUDA fixes + NCCL
URL: https://github.com/apache/incubator-mxnet/pull/9672#discussion_r165660835
 
 

 ##########
 File path: CMakeLists.txt
 ##########
 @@ -168,12 +167,43 @@ endif()
 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
 include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
 
-if(FIRST_CUDA)
+if(USE_CUDA)
+  find_package(CUDA REQUIRED)
+  add_definitions(-DMSHADOW_USE_CUDA=1)
+  if(FIRST_CUDA AND (NOT USE_OLDCMAKECUDA))
+    if(CUDA_TOOLSET STREQUAL "")
+      set(CUDA_TOOLSET "${CUDA_VERSION_STRING}")
 
 Review comment:
   the old code (not written by me) defaulted to Cuda 8 no matter what unless 
CUDA_TOOLKIT var is set.
   my change makes it so that it defaults to whatever version 
find_package(CUDA) finds, which is the default behavior in older versions (non 
FIRST_CUDA versions). this is still overridable by CUDA_TOOLKIT var. if you 
specify a version that way and CMake can?t find it, you get an error (CMake > 
9.0 understands cuda compiling). 
   alternately, you can specify the cuda directory which will be picked up by 
find_package(CUDA). see cmake?s FindCUDA.cmake for details.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to