Skip to content

Commit

Permalink
Set cudart detected version to 9999 if cudaGetDriverVersion fails so …
Browse files Browse the repository at this point in the history
…that the doc build doesn't choke. Report status for unknown CUDA errors when raising cudaError.
  • Loading branch information
lebedov committed Nov 16, 2014
1 parent 1be0505 commit 975ee4f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions scikits/cuda/cudart.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 975ee4f

Please sign in to comment.