summaryrefslogtreecommitdiffstats
path: root/python/astra/astra_c.pyx
diff options
context:
space:
mode:
Diffstat (limited to 'python/astra/astra_c.pyx')
-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")