From 975ee4fd92cac278b66918c332632883057c5f41 Mon Sep 17 00:00:00 2001 From: Lev Givon Date: Sun, 16 Nov 2014 16:11:36 -0500 Subject: [PATCH] Set cudart detected version to 9999 if cudaGetDriverVersion fails so that the doc build doesn't choke. Report status for unknown CUDA errors when raising cudaError. --- scikits/cuda/cudart.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scikits/cuda/cudart.py b/scikits/cuda/cudart.py index 5918c64e..3b485f7f 100644 --- a/scikits/cuda/cudart.py +++ b/scikits/cuda/cudart.py @@ -560,7 +560,7 @@ def cudaCheckStatus(status): try: raise cudaExceptions[status] except KeyError: - raise cudaError + raise cudaError('unknown CUDA error %s' % status) # Memory allocation functions (adapted from pystream): _libcudart.cudaMalloc.restype = int @@ -785,7 +785,11 @@ def cudaDriverGetVersion(): cudaCheckStatus(status) return version.value -_cudart_version = str(cudaDriverGetVersion()) +try: + _cudart_version = str(cudaDriverGetVersion()) +except: + _cudart_version = '9999' + class _cudart_version_req(object): """ Decorator to replace function with a placeholder that raises an exception