diff options
author | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2016-02-29 11:01:21 +0100 |
---|---|---|
committer | Willem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl> | 2016-02-29 11:01:21 +0100 |
commit | b74e64aef7845666d27cbf7e876a6a360eefed7f (patch) | |
tree | 09e4ad58962505fc8f6f551ef96d535619089731 /python | |
parent | cd395d2af23530f9da471fd6c512e9890c08f69d (diff) | |
download | astra-b74e64aef7845666d27cbf7e876a6a360eefed7f.tar.gz astra-b74e64aef7845666d27cbf7e876a6a360eefed7f.tar.bz2 astra-b74e64aef7845666d27cbf7e876a6a360eefed7f.tar.xz astra-b74e64aef7845666d27cbf7e876a6a360eefed7f.zip |
Disable astra.set_gpu_index when building without CUDA
Diffstat (limited to 'python')
-rw-r--r-- | python/astra/astra_c.pyx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/python/astra/astra_c.pyx b/python/astra/astra_c.pyx index 65192b5..baad853 100644 --- a/python/astra/astra_c.pyx +++ b/python/astra/astra_c.pyx @@ -77,7 +77,8 @@ def version(printToScreen=False): else: return getVersion() -def set_gpu_index(idx, memory=0): +IF HAVE_CUDA==True: + def set_gpu_index(idx, memory=0): import types import collections cdef SGPUParams params @@ -90,3 +91,6 @@ def set_gpu_index(idx, memory=0): ret = setGPUIndex(params.GPUIndices[0]) if not ret: six.print_("Failed to set GPU " + str(params.GPUIndices[0])) +ELSE: + def set_gpu_index(idx, memory=0): + raise NotImplementedError("CUDA support is not enabled in ASTRA") |