summaryrefslogtreecommitdiffstats
path: root/python/astra
diff options
context:
space:
mode:
authorWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2016-02-29 11:01:21 +0100
committerWillem Jan Palenstijn <Willem.Jan.Palenstijn@cwi.nl>2016-02-29 11:01:21 +0100
commitb74e64aef7845666d27cbf7e876a6a360eefed7f (patch)
tree09e4ad58962505fc8f6f551ef96d535619089731 /python/astra
parentcd395d2af23530f9da471fd6c512e9890c08f69d (diff)
downloadastra-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/astra')
-rw-r--r--python/astra/astra_c.pyx6
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")