[arrayfire] 62/79: Fix CUDACheckCompute when error is returned

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Mon Jun 15 13:38:08 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch master
in repository arrayfire.

commit 24a7c4f34b339e4a2f6a160bcee3c3192d80792a
Author: Shehzan Mohammed <shehzan at arrayfire.com>
Date:   Thu Jun 11 16:32:01 2015 -0400

    Fix CUDACheckCompute when error is returned
---
 CMakeModules/CUDACheckCompute.cmake | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/CMakeModules/CUDACheckCompute.cmake b/CMakeModules/CUDACheckCompute.cmake
index 574222d..f377c5c 100644
--- a/CMakeModules/CUDACheckCompute.cmake
+++ b/CMakeModules/CUDACheckCompute.cmake
@@ -7,6 +7,7 @@
 
 IF(CUDA_FOUND)
     MESSAGE(STATUS "${CMAKE_MODULE_PATH}/cuda_compute_capability.cpp")
+
     TRY_RUN(RUN_RESULT_VAR COMPILE_RESULT_VAR
         ${CMAKE_BINARY_DIR}
         ${CMAKE_MODULE_PATH}/cuda_compute_capability.cpp
@@ -15,20 +16,23 @@ IF(CUDA_FOUND)
         -DLINK_LIBRARIES:STRING=${CUDA_CUDART_LIBRARY}
         COMPILE_OUTPUT_VARIABLE COMPILE_OUTPUT_VAR
         RUN_OUTPUT_VARIABLE RUN_OUTPUT_VAR)
-    MESSAGE(STATUS "Output: ${RUN_OUTPUT_VAR}")
-    IF(COMPILE_RESULT_VAR)
-        # Convert output into a list of computes
-        STRING(REPLACE " " ";" COMPUTES_DETECTED_LIST ${RUN_OUTPUT_VAR})
-    ELSE()
-        MESSAGE(STATUS "didn't compile")
-    ENDIF()
+
+    MESSAGE(STATUS "CUDA Compute Detection Output: ${RUN_OUTPUT_VAR}")
+    MESSAGE(STATUS "CUDA Compute Detection Return: ${RUN_RESULT_VAR}")
+
     # COMPILE_RESULT_VAR is TRUE when compile succeeds
-    # RUN_RESULT_VAR is zero when a GPU is found
-    IF(COMPILE_RESULT_VAR AND NOT RUN_RESULT_VAR)
+    # Check Return Value of main() from RUN_RESULT_VAR
+    # RUN_RESULT_VAR is 0 when a GPU is found
+    # RUN_RESULT_VAR is 1 when errors occur
+
+    IF(COMPILE_RESULT_VAR AND RUN_RESULT_VAR EQUAL 0)
         MESSAGE(STATUS "CUDA Compute Detection Worked")
+        # Convert output into a list of computes
+        STRING(REPLACE " " ";" COMPUTES_DETECTED_LIST ${RUN_OUTPUT_VAR})
         SET(CUDA_HAVE_GPU TRUE CACHE BOOL "Whether CUDA-capable GPU is present")
     ELSE()
-        MESSAGE(STATUS "didn't work")
+        MESSAGE(STATUS "CUDA Compute Detection Failed")
         SET(CUDA_HAVE_GPU FALSE CACHE BOOL "Whether CUDA-capable GPU is present")
     ENDIF()
-endif()
+
+ENDIF(CUDA_FOUND)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/arrayfire.git



More information about the debian-science-commits mailing list