From b74e64aef7845666d27cbf7e876a6a360eefed7f Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Mon, 29 Feb 2016 11:01:21 +0100 Subject: Disable astra.set_gpu_index when building without CUDA --- python/astra/astra_c.pyx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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") -- cgit v1.2.3